Questions tagged [docker-volume]

A docker data volume is a specially-designated directory within one or more containers that bypasses the Union File System.

A docker data volume is a specially-designated directory within one or more containers that bypasses the Union File System. Data volumes provide several useful features for persistent or shared data:

  • Volumes are initialized when a container is created. If the container’s base image contains data at the specified mount point, that existing data is copied into the new volume upon volume initialization.
  • Data volumes can be shared and reused among containers.
  • Changes to a data volume are made directly.
  • Changes to a data volume will not be included when you update an image.
  • Data volumes persist even if the container itself is deleted.

Reference: https://docs.docker.com/engine/userguide/dockervolumes/

1047 questions
11
votes
1 answer

Relative Path with Docker-Compose Shared Volumes

It seems this question has already been asked by another poster, but there was no answer. I have more information on the matter, so I'm re-asking the same question - but with much additional material. I'm running Docker on Windows 10. I have…
Brent Arias
  • 26,187
  • 32
  • 120
  • 209
11
votes
2 answers

Invalid type in docker-compose volume

I try to setup a bind volume in my docker-compose but I get the following error: docker-compose up ERROR: The Compose file './docker-compose.yml' is invalid because: services.web.volumes contains an invalid type, it should be a string My…
Nicolas
  • 1,913
  • 2
  • 22
  • 40
11
votes
1 answer

Deploy web app in docker data container vs volume

I'm confused about common consensus that one shouldn't use data containers. I have specific use case that I want to accomplish. I want to have docker nginx container and behind it some other container with application. To run newest version of my…
Zveratko
  • 2,349
  • 3
  • 26
  • 53
11
votes
3 answers

How to cache package manager downloads for docker builds?

If I run composer install from my host, I hit my local composer cache: - Installing deft/iso3166-utility (1.0.0) Loading from cache Yet when building a container having in its Dockerfile: RUN composer install -n -o --no-dev I download all…
k0pernikus
  • 41,137
  • 49
  • 170
  • 286
10
votes
1 answer

Docker Compose Relative paths vs Docker volume

I have a docker compose file for a website, which amongst a bunch of other containers for various purposes, includes a mysql database that will have persistent data. At the moment the compose file specifies a relative path for the data, e.g.: …
statts
  • 105
  • 1
  • 1
  • 4
10
votes
1 answer

docker-compose won't use my named volumes

So I'm fairly new to docker. I have an issue with attaching my named volumes to services in my swarm. Here is my docker-compose.yml... version: '3' services: ned: image: keli ports: - "8080:8080" depends_on: - craig -…
navanjr
  • 403
  • 3
  • 10
9
votes
2 answers

Why doesn't my docker-compose volume get updated with local file additions?

Here's my docker-compose.yml, it contains a web service, which mounts a folder locally so that upon any code change watchmedo restarts the webapp django server. It's a reverse proxy with nginx. version: '3' services: webapp: build: …
lollercoaster
  • 13,421
  • 28
  • 94
  • 162
9
votes
3 answers

Accessing Docker Volume content on MacOS

When I do a docker volume inspect on a Mac, I can see the path to the data, this appears as a /var/lib/docker/volumes/ On a Mac, this link does not exist, because docker runs on inside a very tiny VM. I can use screen…
jwknz
  • 5,584
  • 13
  • 64
  • 105
9
votes
8 answers

docker-compose on Windows volume not working

I've been playing with Docker for the past week and think the container idea is very useful, but despite reading everything I can for the past 3 days I can't get the volume mapping to work get docker-compose to use my existing volume. Docker…
Maui_Ed
  • 205
  • 1
  • 2
  • 6
9
votes
3 answers

How to create docker volume device/host path

I believe there is an easy way to copy files into a docker volume that has already been mounted to a container. docker cp /tmp/my_data/. my_container:/my_data as referenced by How to copy multiple files into a docker data volume But, how does one…
loonyuni
  • 923
  • 3
  • 11
  • 19
9
votes
1 answer

How I can access docker data volumes on Windows machine?

I have docker-compose.yml like this: version: '3' services: mysql: image: mysql volumes: - data:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=$ROOT_PASSWORD volumes: data: And my mount point looks like:…
9
votes
1 answer

How to sync code between container and host using docker-compose?

Until now, I have used a local LAMP stack to develop my web projects and deploy them manually to the server. For the next project I want to use docker and docker-compose to create a mariaDB, NGINX and a project container for easy developing and…
pBuch
  • 926
  • 1
  • 6
  • 19
9
votes
3 answers

expose files from docker container to host

I have a docker container that holds a django app. The static files are produced and copied to a static folder. container folder hierarchy: - var - django - app - static before i build the docker image, i run ./manage.py…
Mr T.
  • 3,810
  • 6
  • 32
  • 57
8
votes
1 answer

Backup and restore docker named volume

I have question regarding volumes and ownership. As an example I'm using this image: privatebin, but this is the same for any case. First I'm creating volume: $ docker volume create privatebin-data From docker inspect, I can see where data is…
Robert Maguda
  • 83
  • 1
  • 3
8
votes
3 answers

Create docker volume with limited size

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…
batilei
  • 353
  • 4
  • 13
1 2
3
69 70