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
22
votes
3 answers

HostPath with minikube - Kubernetes

UPDATE: I connected to the minikubevm and I see my host directory mounted but there is no files there. Also when I create a file there it will not in my host machine. Any link are between them I try to mount an host directory for developing my app…
21
votes
4 answers

Remove Airflow Scheduler logs

I am using Docker Apache airflow VERSION 1.9.0-2 (https://github.com/puckel/docker-airflow). The scheduler produces a significant amount of logs, and the filesystem will quickly run out of space, so I am trying to programmatically delete the…
Ryan Stack
  • 1,231
  • 1
  • 12
  • 25
20
votes
3 answers

How to delete volumes in swarm cluster?

I have a swarm cluster with one manager and another normal node , when I create a swarm service I am creating with mount type ,mount source and mount target . It creates the volume with the same name in both manger and node and starts the container…
Vishnu Ranganathan
  • 1,277
  • 21
  • 45
20
votes
4 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
  • 60,309
  • 67
  • 216
  • 347
19
votes
2 answers

Docker volumes on WSL2 using Docker Desktop

I'm just trying out WSL 2 with Docker for Windows and I'm having an issues with mounted volumes : version: "3.7" services: node: build: . container_name: node hostname: node volumes: - ./app:/app …
19
votes
3 answers

Backup docker volumes - is simple tar-archiving not sufficient?

I am running several Docker containers on three machines, composing a Swarm cluster. Some containers that stores persistent data(like DB, Redis, etc) use data volumes. (I tried to avoid using bind-mount as far as I can) Such data volumes are located…
gypark
  • 612
  • 7
  • 26
18
votes
6 answers

User not created in MySQL when using docker-compose

This is what I see when I am in the container created by docker-compose: mysql> SELECT user FROM mysql.user; +------+ | user | +------+ | root | +------+ 1 row in set (0.00 sec) root@541e4d686184:/# echo $MYSQL_USER dbuser So dbuser is not present…
James Black
  • 41,583
  • 10
  • 86
  • 166
17
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
  • 2,191
  • 3
  • 29
  • 49
16
votes
1 answer

How to restore database from dump or sql file in docker using volume?

I am trying to run my database in docker which already have some data into it, But when I run it in docker it gives empty .. So how to restore my database in docker PostgreSQL image.
Yesha Dave
  • 171
  • 1
  • 1
  • 7
16
votes
1 answer

docker-compose v3: sharing bind-mounted volume between multiple containers with top-level volumes syntax

With v2 of docker-compose synthax, we were able to do something like this: version: '2' services: app: image: tianon/true volumes: - ../app:/var/www/app nginx: image: nginx volumes_from: - app php: image: php …
m0onspell
  • 517
  • 5
  • 13
16
votes
7 answers

Can't Delete file created via Docker

I used a docker image to run a program on our school's server using this command. docker run -t -i -v /target/new_directory 990210oliver/mycc.docker:v1 /bin/bash After I ran it it created a firectory on my account called new_directory. Now I don't…
Katie
  • 239
  • 1
  • 2
  • 9
15
votes
4 answers

Why docker-compose creates directories/files with user:group 999:999?

I used docker-compose up with the following docker-compose.yml version: '3.5' services: mysql-server: image: mysql:5.7 environment: - MYSQL_ROOT_PASSWORD=root_pwd volumes: - ./var/lib/mysql:/var/lib/mysql:rw The directory…
Marinos An
  • 9,481
  • 6
  • 63
  • 96
15
votes
2 answers

Docker volumes : specifying permissions using mount options

I'm trying to use a named volume mounted in a Docker container, but get a Permission denied error when trying to create a file in the mounted folder. So I'm trying to use mount options when creating my volume, but that does not work as I…
norbjd
  • 10,166
  • 4
  • 45
  • 80
14
votes
2 answers

define volumes in docker-compose.yaml

I am writing a docker-compose.yaml file for my project. I have checked the volumes documentation here . I also understand the concept of volume in docker that I can mount a volume e.g. -v my-data/:/var/lib/db where my-data/ is a directory on my host…
user842225
  • 5,445
  • 15
  • 69
  • 119
14
votes
1 answer

Docker compose: meaning of {} in volume definition

What is the meaning of {} in volume definition? For example version: '2' volumes: dataelasticsearch: {} services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:5.4.3 volumes: -…
Dušan Maďar
  • 9,269
  • 5
  • 49
  • 64
1 2
3
93 94