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/

1402 questions
10
votes
2 answers

Docker volume: rename or copy operation

As per documentation Docker volumes are advertised this way: Volumes are the preferred mechanism for persisting data generated by and used by Docker containers. While bind mounts are dependent on the directory structure and OS of the host machine,…
Jimmix
  • 5,644
  • 6
  • 44
  • 71
10
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
  • 15,969
  • 35
  • 115
  • 173
10
votes
0 answers

Docker share node_modules to host

i have some scenario that i cant solve. angular 5 application development. docker file that copies the package.json and during the build npm installs the node_modules. and i want those node_modules to be visible on host so developer can work…
10
votes
1 answer

I am trying to use gcs bucket as the volume in gke pod

I am getting the error: error validating "mysql.yaml": error validating data: ValidationError(Deployment.spec.template.spec.volumes[0]): unknown field "path" in io.k8s.kubernetes.pkg.api.v1.Volume; ) apiVersion: extensions/v1beta1 kind:…
10
votes
3 answers

Docker mounting volume. Permission denied

I have a problem with creating new files in mounted docker volume. Firstly after installation docker i added my user to docker group. sudo usermod -aG docker $USER Created as my $USER folder: mkdir -p /srv/redis And starting container: docker run…
moviss
  • 179
  • 1
  • 2
  • 12
10
votes
2 answers

Recover configuration of Grafana-docker persistent volume?

I did a Grafana-docker deployment with persistent storage as said in their GitHub for doing tests for my company. I did exactly as they say (I paste) and it works: # create /var/lib/grafana as persistent volume storage docker run -d -v…
xCovelus
  • 578
  • 1
  • 9
  • 20
10
votes
1 answer

How am I supposed to access a named volume from the host?

I'm new to the Docker world and I'm trying to achieve something one could think is trivial. However, it seems a lot of beginners struggle to persist their data when using Docker. I've built a custom image using a Dockerfile. The container runs a…
GuiTeK
  • 1,561
  • 5
  • 20
  • 39
10
votes
3 answers

How to specify the size of a shared Docker volume?

If I would like to create a data volume of let´s say 15GB that would be of type ext4, how would I do that? docker volume create --name vol just creates an empty volume. docker volume create --opt type=ext4 --name vol creates an ext4 volume but I…
Rox
  • 2,647
  • 15
  • 50
  • 85
9
votes
4 answers

Docker - chown: changing ownership of '/data/db': Operation not permitted

I am trying to run my application using Docker and here is my yml file content to run the mongo container. services: mongodb: image: mongo:3.4 # ports: # - "27017:27017" volumes: - ./data/mongo:/data/db …
Codeformer
  • 2,060
  • 9
  • 28
  • 46
9
votes
2 answers

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
  • 93
  • 1
  • 4
9
votes
0 answers

Change source path of volume

This dockerfile works as expected. But the problem is that I am not able to change the source of volume. version: "3.5" services: mysql: environment: MYSQL_ROOT_PASSWORD: india3391 image: shantanuo/mysql:5.7 ports: - mode:…
shantanuo
  • 31,689
  • 78
  • 245
  • 403
9
votes
1 answer

What are volume driver in docker container

While doing volume mounting in a docker container there is a optional parameter --volume-driver string Optional volume driver for the container What is the use of this parameter?
sunil
  • 1,259
  • 1
  • 14
  • 27
9
votes
1 answer

How to store a specific named docker volume at a specific location without changing the default?

I would like to create a named volume for one of my containers. This container will need a lot more storage than other containers I run, so I would like to store that particular volume on a different disk that has lots of free space. I still want…
springloaded
  • 1,079
  • 2
  • 13
  • 23
9
votes
3 answers

How to migrate Docker volume between hosts?

Docker's documentation states that volumes can be "migrated" - which I'm assuming means that I should be able to move a volume from one host to another host. (More than happy to be corrected on this point.) However, the same documentation page…
ericmjl
  • 13,541
  • 12
  • 51
  • 80
9
votes
1 answer

Why can't composer find a composer.json file inside my Docker container?

I have a pretty straightforward Dockerfile based on Thelia's and Composer's. I want it to do as much setup as possible, so to that end, I am installing composer in the PATH within the container and then trying to run composer install. However, at…
acobster
  • 1,637
  • 4
  • 17
  • 32