About 162,000 results
Open links in new tab
  1. What is a docker-compose.yml file? - Stack Overflow

    Mar 15, 2022 · Docker Compose is a YAML file to configure your application's services, and create and start all of them from your configuration with command (docker compose up). Docker Compose is included in Docker Desktop for windows and macOS, and for linux you can download its binary file from here. An example of docker-compose.yml for a project having ...

  2. How do I mount a host directory as a volume in docker compose

    Dec 1, 2016 · If you would like to mount a particular host directory (/disk1/prometheus-data in the following example) as a volume in the volumes section of the Docker Compose YAML file, you can do it as below, e.g.:

  3. define volumes in docker-compose.yaml - Stack Overflow

    Aug 4, 2021 · Mapped volumes can either be files/directories on the host machine (sometimes called bind mounts in the documentation) or they can be docker volumes that can be managed using docker volume commands. The volumes: section in a docker-compose file specify docker volumes, i.e. not files/directories. The first docker-compose in your post uses such a ...

  4. How to specify Memory & CPU limit in docker compose version 3

    I have it in a directory called estest the file is called es-compose.yaml. The file sets CPU and memory limits. If you launch using docker-compose e.g. docker-compose -f es-compose.yaml up Then look at docker stats you see

  5. How do I define the name of image built with docker-compose

    Aug 26, 2015 · Once docker-compose 1.6.0 is out, you may specify build: and image: to have an explicit image name (see arulraj.net's answer). Option 3: Create image from container. A third is to create an image from the container: $ docker-compose up -d bar $ docker commit $(docker-compose ps -q bar) foo_bar $ docker-compose rm -f bar

  6. How does docker-compose.yml and Dockerfile work together?

    Mar 16, 2021 · But on top of that, compose can streamline the entire setup process, i.e. it can first build the image and then run it. That's what the line build: ./ is for; it just tells the compose process to look for a Dockerfile in the current working directory when building the image.

  7. How can I use environment variables in docker-compose?

    Docker Compose has native support for default environment variables in a file. All you need to do is declare your variables in a file named .env and they will be available in docker-compose.yml. For example, for a .env file with contents: MY_SECRET_KEY=SOME_SECRET IMAGE_NAME=docker_image

  8. Create database on docker-compose startup - Stack Overflow

    Apr 10, 2017 · Mount the setup script into the directory f within the docker-compose.yaml file (see below for an example) Run docker-compose up -d and MySQL will run the code inside setup.sql; Note: the script will run files alphabetically, so keep that in mind. Example docker-compose.yaml

  9. Simple docker-compose.yml to setup an Ubuntu container with …

    Feb 2, 2022 · This should move to Docker now since I would like to reduce complexity and increase maintainability (I have couple of other containers running perfectly). What I've tried so far: Created a docker-compose.yml & Dockerfile and connected a local folder; Got access to the container with "docker container exec -ti bash"

  10. How to directly mount NFS share/volume in container using …

    First, you can create the named volume directly and use it as an external volume in compose, or as a named volume in a docker run or docker service create command. # create a reusable volume $ docker volume create --driver local \ --opt type=nfs \ --opt o=nfsvers=4,addr=nfs.example.com,rw \ --opt device=:/path/to/dir \ foo

Refresh