docker-volume

Docker-Compose won't volume my php.ini file

大兔子大兔子 提交于 2019-11-30 22:25:57
I'm trying to use docker-compose to volume my php.ini file so I can make changes on the fly on my local machine to see how it affects the host machine. Unfortunately the only way I've been able to get the php.ini file into the container is directly during creation in the Dockerfile so far. Attached is an image of the container running fine with the current settings below. My Dockerfile is below: FROM ubuntu:14.04 MAINTAINER Joe Astrahan <jastrahan@poolservice.software> VOLUME ["/var/www"] RUN apt-get update && \ apt-get install -y software-properties-common && \ apt-get update && \ apt-get

Docker in Docker - volumes not working: Full of files in 1st level container, empty in 2nd tier

梦想与她 提交于 2019-11-30 21:32:29
I am running Docker in Docker (specifically to run Jenkins which then runs Docker builder containers to build a project images and then runs these and then the test containers). This is how the jenkins image is built and started: docker build --tag bb/ci-jenkins . mkdir $PWD/volumes/ docker run -d --network=host \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /usr/bin/docker:/usr/bin/docker \ -v $PWD/volumes/jenkins_home:/var/jenkins_home \ --name ci-jenkins bb/ci-jenkins Jenkins works fine. But then there is a Jenkinsfile based job, which runs this: docker run -i --rm -v /var/jenkins_home

Docker-Compose won't volume my php.ini file

感情迁移 提交于 2019-11-30 17:06:18
问题 I'm trying to use docker-compose to volume my php.ini file so I can make changes on the fly on my local machine to see how it affects the host machine. Unfortunately the only way I've been able to get the php.ini file into the container is directly during creation in the Dockerfile so far. Attached is an image of the container running fine with the current settings below. My Dockerfile is below: FROM ubuntu:14.04 MAINTAINER Joe Astrahan <jastrahan@poolservice.software> VOLUME ["/var/www"] RUN

docker-compose volume on node_modules but is empty

余生颓废 提交于 2019-11-30 12:09:29
I'm pretty new with Docker and i wanted to map the node_modules folder on my computer (for debugging purpose). This is my docker-compose.yml web: build: . ports: - "3000:3000" links: - db environment: PORT: 3000 volumes: - .:/usr/src/app - /usr/src/app/node_modules db: image: mongo:3.3 ports: - "27017:27017" command: "--smallfiles --logpath=/dev/null" I'm with Docker for Mac. When i run docker-compose up -d all go right, but it create a node_modules folder on my computer but it's empty. I go into the bash of my container and ls node_modules, all the packages was there. How can i get the

docker-compose volume on node_modules but is empty

烂漫一生 提交于 2019-11-29 18:00:28
问题 I'm pretty new with Docker and i wanted to map the node_modules folder on my computer (for debugging purpose). This is my docker-compose.yml web: build: . ports: - "3000:3000" links: - db environment: PORT: 3000 volumes: - .:/usr/src/app - /usr/src/app/node_modules db: image: mongo:3.3 ports: - "27017:27017" command: "--smallfiles --logpath=/dev/null" I'm with Docker for Mac. When i run docker-compose up -d all go right, but it create a node_modules folder on my computer but it's empty. I go

chown docker volumes on host (possibly through docker-compose)

孤人 提交于 2019-11-29 07:11:59
I have the following example version: '2' services: proxy: container_name: proxy hostname: proxy image: nginx ports: - 80:80 - 443:443 volumes: - proxy_conf:/etc/nginx - proxy_htdocs:/usr/share/nginx/html volumes: proxy_conf: {} proxy_htdocs: {} which works fine. When I run docker-compose up it creates those named volumes in /var/lib/docker/volumes and all is good. However, from the host, I can only access /var/lib/docker as root, because it's root:root (makes sense). I was wondering if there is a way of chown ing the host's directories to something more sensible/safe (like, my relatively

ERROR: In file './docker-compose.yml', volume must be a mapping not a string

六眼飞鱼酱① 提交于 2019-11-29 03:18:40
Why do I get this error? ERROR: In file './docker-compose.yml', volume 'mariavolume' must be a mapping not a string. My docker-compose file is almost identical to this one: https://docs.docker.com/compose/wordpress/ version: '2' services: wordpress: image: wordpress:latest restart: always depends_on: - db ports: - 8080:80 environment: WORDPRESS_DB_PASSWORD: example WORDPRESS_DB_HOST: 3306 db: image: mariadb restart: always environment: MYSQL_ROOT_PASSWORD: example volumes: - maria_volume: /var/lib/mysql volumes: maria_volume: ~/mariadb DaNeSh Unfortunately, there is no such a feature. You can

Create docker volume with limited size

百般思念 提交于 2019-11-29 02:32:06
There is is very limited information regarding create volume with options " https://docs.docker.com/engine/reference/commandline/volume_create/ ". I just want to create a volume with limited size, I tried, docker volume create --opt o=size=10m hello-volume , when run a simple hello world container with “docker run -v hello-volume:/hello -it ubuntu /bin/bash”, I got the error as something like “docker: Error response from daemon: …no such device”… So I assumed we must give the full options when creating the volume, such as “docker volume create --driver local --opt type=*** --opt device=*** -

Docker-compose named mounted volume

女生的网名这么多〃 提交于 2019-11-28 04:29:00
In order to keep track of the volumes used by docker-compose i like to use named volumes. This works great for 'normal' volumes like version: 2 services: example-app: volume: -named_vol:/dir/in/container/volume volumes: named_vol: But i cant figure out how to make it work when mounting the local host. I'm looking for something like: version: 2 services: example-app: volume: -named_homedir:/dir/in/container/volume volumes: named_homedir: /c/Users/ or version: 2 services: example-app: volume: -/c/Users/:/home/dir/in/container/ --name named_homedir is this in any way possible or am i stuck with

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

青春壹個敷衍的年華 提交于 2019-11-28 03:53:16
I have a development environment I'm dockerizing and I would like the ability to livereload my changes without having to rebuild docker images. I'm using docker compose because redis is one of my app's dependencies and I like being able to link a redis container I have two containers defined in my docker-compose.yml : node: build: ./node links: - redis ports: - "8080" env_file: - node-app.env redis: image: redis ports: - "6379" I've gotten to the point in my node app's dockerfile where I add a volume, but how do I mount the the host's directory in the volume so that all my live edits to the