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
8
votes
2 answers

What is the difference between container layer and volume in Docker?

In the context of docker I understand what layers of an image is and what's the uppermost writable layer. If I run docker container without any -v arguments will any volumes get created? If I do specify a volume (which is not a mount to some…
The Governor
  • 1,152
  • 1
  • 12
  • 28
8
votes
2 answers

Access file of windows machine from docker container

I have installed Docker Desktop for Windows in Windows 10 operating system. I am running a python script inside docker container which reads file from disk and add few text at the end of files. Now the requirement is to read files from Windows 10…
8
votes
1 answer

Named Docker volume to share build not updating

I have been asked by dev ops at the company I am working for to do something a little different with Docker then I am used too. The goal is to have 2 containers with the following responsibilities: Container A: Node container that will build the…
Shawn
  • 667
  • 8
  • 19
7
votes
2 answers

Docker - is it safe to switch to non-root user in ENTRYPOINT?

Is it considered a secure practice to run root privileged ENTRYPOINT ["/bin/sh", entrypoint.sh"], that later switches to non-root user before running the application? More context: There are a number of articles (1, 2, 3) suggesting that running…
Voy
  • 5,286
  • 1
  • 49
  • 59
7
votes
2 answers

Dockerfile - How to copy files from a local folder?

Below is the Dockerfile: FROM golang:1.14.10 MAINTAINER xyz COPY ~/go/bin/product-api /go/bin/product-api COPY ~/go/bin/swagger /go/bin/swagger ENTRYPOINT ["/go/bin/product-api"] on docker build -t cloud-native-product-api:1.0.0 ., gives…
overexchange
  • 15,768
  • 30
  • 152
  • 347
7
votes
3 answers

Docker persisted volum has no permissions (Apache Solr)

My docker-compose.yml: solr: image: solr:8.6.2 container_name: myproject-solr ports: - "8983:8983" volumes: - ./data/solr:/var/solr/data networks: static-network: ipv4_address: 172.20.1.42 After bringing…
7
votes
4 answers

How to remove docker-volume of (removed) docker-container?

I have tests that runs lots of docker containers. each of them has a volume. How can I know the volume name that I need to delete? for example: ~ docker run -d registry:2 ~ docker volume inspect…
Stav Alfi
  • 13,139
  • 23
  • 99
  • 171
7
votes
4 answers

Show size of all docker volumes without mounting them

How to list all docker volumes together with their respective size. docker volume inspect $(docker volume ls) gives information about all volumes but each volume's size. Preferably, I'd like to inspect the size without having to mount them into…
mcExchange
  • 6,154
  • 12
  • 57
  • 103
7
votes
2 answers

docker volume over fuse : Transport endpoint is not connected

So I have this remote folder /mnt/shared mounted with fuse. It is mostly available, except there shall be some disconnections from time to time. The actual mounted folder /mnt/shared becomes available again when the re-connection happens. The issue…
Augustin Riedinger
  • 20,909
  • 29
  • 133
  • 206
7
votes
2 answers

How to mount volume to docker on OSX?

I have a problem mounting a host machine volume to a docker image. I've added a folder to docker File sharing settings, but it doesn't get any effect. What do I have to do to solve the problem? For example, I try to mount a volume which was added…
Mikhail
  • 71
  • 1
  • 3
7
votes
2 answers

Persist apache nifi flow.xml.gz file in docker volume

How can I persist the flow.xml.gz file in nifi docker container? I am using a docker-compose file, it is giving me errors such as not finding certain files. Didi you encounter the same issue? Thanks version: "3.3" services: nifi: image:…
3nomis
  • 1,175
  • 1
  • 9
  • 30
7
votes
1 answer

Docker volume in swarm

Can someone confirm this for me. When running a service in docker with swarm, the docker volume using the local driver will be created on the same node as the running container for a service. If a service was spawning tasks on 2 different nodes,…
Loïc Faure-Lacroix
  • 13,220
  • 6
  • 67
  • 99
7
votes
4 answers

How to access PersistentVolume files on docker-for-desktop?

I'd like to access and edit files in my Kubernetes PersistentVolume on my local computer (macOS), but I cannot understand where to find those files! I'm pointing my hostPath to /tmp/wordpress-volume but I cannot find it anywhere. What is the hidden…
a.barbieri
  • 2,398
  • 3
  • 30
  • 58
7
votes
1 answer

How to copy files to a Docker volume and use that volume with docker-compose

There is a webservice running in a Docker container. This webservice relies on big json files to boot. I create a Docker volume to store the json files with docker volume create my-api-files. Here is the docker-compose file for the…
François Romain
  • 13,617
  • 17
  • 89
  • 123
7
votes
0 answers

Docker: share data between containers in non-persistent way to allow for code upgrade

In a php-fpm and nginx container setup the source code usually needs to be available to both containers. In my case I'd like to dockerize Magento. In Magento the nginx is configured in such a way that it looks for the existence of files before it…
Soeren
  • 81
  • 4