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

How to persist data in a Docker .NET Core Web app?

I have trouble understanding how to work with data in a WebApi-app running with Docker. In my app, a user can upload files which are stored like this: ~\App_Data\accounts\user123\files\.bin Without configuring any volumes, a Docker container…
Andreas Zita
  • 7,232
  • 6
  • 54
  • 115
6
votes
3 answers

How to test a docker volume?

I want to test if I did my docker-compose.yml correctly. The new thing is a volume app: image: gitlab-${smt}:5005/smt/my-app:latest container_name: app volumes: - /var/run/docker.sock:/var/run/docker.sock -…
Jerome
  • 1,162
  • 2
  • 16
  • 32
6
votes
1 answer

Moving files into a Docker Data Volume

First I create a volume: docker volume create --name some-volume Then I create a file touch ~/somefile.txt Now I want to move ~/somefile.txt into the root of the volume some-volume. How do I do this?
Ole
  • 41,793
  • 59
  • 191
  • 359
6
votes
1 answer

How to Increase the Speed of Docker Builds While Using Mounted Volumes

Docker is slow writing to the host file system when using volumes. This makes tasks like npm install, in NodeJS, incredibly painful. How can I exclude the node_modules folder from the volume so the build is faster?
Fred Lackey
  • 2,351
  • 21
  • 34
6
votes
1 answer

How to add $(...) in Docker Compose

I have a docker-compose.yml which contains the stuff to start a jenkins-server on CentOS7: jenkins: image: jenkins volumes: - /var/run/docker.sock:/var/run/docker.sock - $(which docker):/usr/bin/docker:ro -…
lvthillo
  • 28,263
  • 13
  • 94
  • 127
5
votes
2 answers

Allow Docker Container & Host User To Write on Bind Mounted Host Directory

Any help from any source is appreciated. Server has a Docker container with alpine, nginx, php. This container is able to write in bind mounted host directory, only when I set "chown -R nobody directory" to the host directory (nobody is a user in…
proseosoc
  • 1,168
  • 14
  • 23
5
votes
1 answer

Apache Solr Cloud Backup Issues to path when 'solr.allowPaths' is set

I am trying to backup a solr cloud collection. Solr and Zookeeper are running in docker containers. There are 3 solr (using ports: 8981,8982,8983) and 3 ZKs containers running. I am passing a docker volume to the solr containers volumes: -…
J.Alex
  • 103
  • 8
5
votes
1 answer

Docker dpage/pgAdmin - permission denied /var/lib/pgadmin/storage

i have a dpage/pgadmin:latest Docker container running on an Ubuntu 20.04. Client: Docker Engine - Community Version: 20.10.8 Server: Docker Engine - Community Engine: Version: 20.10.8 docker-compose version 1.25.4, build…
alexjoedt
  • 121
  • 5
5
votes
2 answers

Volume myvol specifies nonexistent driver azurefile

Net core application and I am trying to mount azure file share. Below is my docker-compose file. version: "3.9" services: mountvolume: container_name: mountvolume build: context: . dockerfile: ./Dockerfile …
5
votes
0 answers

Docker Swarm and NFS volumes (starting container failed: error while mounting; volume failed to mount local volume)

I want to create a Swarm cluster with three nodes and one shared volume (in windows 10). I use docker-machine for it: docker-machine create -d virtualbox swarm1-mgr1 docker-machine create -d virtualbox swarm1-wrk1 docker-machine create -d virtualbox…
illuminato
  • 1,057
  • 1
  • 11
  • 33
5
votes
2 answers

Docker compose volume: copying folder from docker container to host when executing docker-compose up

I have this simple docker-compose.yaml (image from danielemaddaluno/self-service-password): version: "3" services: ltb: image: danielemaddaluno/self-service-password ports: - 8080:80 volumes: -…
madx
  • 6,723
  • 4
  • 55
  • 59
5
votes
5 answers

How to copy files inside container with docker-compose

I have a simple image that runs a jar file. That jar file inside the image needs a special configuration file in order to run. In the location with the docker-compose.yml I have a folder named "carrier" and under this folder I have that file. The…
5
votes
0 answers

How to use a custom volume bootstrap image in vscode remote for containers when cloning a repository into a volume?

When cloning a repository into a volume with the vscode remote extension for containers, an Alpine linux is downloaded from docker.io to bootstrap the volume (initially). This is only used to create the volume. The image which is then used for my…
ssc-hrep3
  • 15,024
  • 7
  • 48
  • 87
5
votes
1 answer

How to take backup of docker volumes?

I'm using named volumes to persist data on Host machine in the cloud. I want to take backup of these volumes present in the docker environment so that I can reuse them on critical incidents. Almost decided to write a python script to compress the…
Venkat Ch
  • 1,168
  • 2
  • 17
  • 37
5
votes
2 answers

Docker run -v : Unable to mount a bind volume : "invalid volume specification"

I'm quite new to Docker. I'm running on Windows 10 Enterprise and am trying to containerize an existing app that runs on windows (so it's a Windows container). I don't know if this matters but the container is rather large (8 GB). I need to share a…