Hot answers tagged

10

Docker Prepends the current folder name with all the components name created using docker compose file. Eg : If the current folder name containing the docker-compose.yml file is test, all the volumes,network and container names will get test appended to it. In order to solve the problem people earlier proposed the idea of using -p flag with docker-compose ...


8

Thanks to the people here, the solution is quite simple (but not obvious): My GNU/Linux container host has SELinux activated, and that's why I was having permissions problems. The solution is to simply append a :z to the podman run volume argument so that this: podman run -it -v /host/foobar:/src_dir /bin/bash becomes this: podman run -it -v /host/foobar:...


8

Yes. Just use ./ for you current directory that the Docker-compose file is in. Your "working directory" for the compose file is just "./". If you are trying to set a directory below that it would look something like: volumes: ./DirectoryIWantToTarget:/tmp There's an example of this in the Docker-Compose documentation here. This ...


3

PS C:\Users\gaius> Write-Output $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 5 1 17763 592 PS C:\Users\gaius> Write-Output $pwd Path ---- C:\Users\gaius That appears to work as expected, what versions of things are you using? Compare to Linux: gaius@klossy:~$ pwsh ...


3

What about creating docker volumes yourself instead of letting docker to that for you? https://docs.docker.com/engine/reference/commandline/volume_create/ If one creates docker volumes yourself then the parent folder will not be automatically concatenated.


2

It seems there is a spacing issue in your yaml You should change the compose file to version : '3.4' services: testando-volume-compartilhado-a: image: carloshenriquecarniatto/teste:latest volumes: - D:\App:/app # <- extra space here ports: - "10001:80" - "44378:443"


2

Single quotes in shell meant to leave the enclosed string 'as is'. That is the variable inside single quotes isn't going to be evaluated. Try changing '${WORKSPACE}' for "${WORKSPACE}".


1

Symlink is an universal solution which works, I've successfully used it plenty of times. I do not recommend using the path you suggested, though, since the files should be owned by either the root or docker users, depending on your distro/OS. Therefore, if you want to use the /home partition, then: shut down docker mv /var/lib/docker /home/ ln -s /home/...


1

I have been using Linux and since Docker volume caches the data, it is merely persistent until you remove it manually. In RHEL8, /var/lib/docker/volumes/, this is where all the volume mounts are stored. You can check if the same directory exists in MacOS. I haven't use Mac but I hope this helps.


1

In my opinion, you could create bucket (aws s3 for example) and store your data there (create simple app to make upload), thus, you don’t need to care with disk full error


1

You can mount a volume e.g. at /app/artifacts then set up your application to place the artifacts on that folder. docker run -d \ -v artifacts-vol:/app/artifacts \ artifact-creator:latest then after that, you can mount the same volume to a separate container and specify on the new container to read the artifacts from the volume location docker run -d \ -...


1

Define the volume in the following way volumes: - ${local_path}:/data or using docker volumes version: '3.7' volumes: db-data: services: one: image: alpine command: sh -c 'echo one >> /data/db.txt && cat /data/db.txt | wc -l' volumes: - db-data:/data


1

based on @ulrich answer, but with mysqldump : DATE_TIME=`date +"%Y%m%d_%H%M" CONTAINER_NAME="mysql_server" CONTAINER=`docker ps -q -f name=${CONTAINER_NAME}` PASSWORD=`docker exec ${CONTAINER} sh -c 'echo $MYSQL_ROOT_PASSWORD'` BACKUP_FILE=${DATE_TIME}_${CONTAINER_NAME}.backup.sql.gz CONTAINER_BACKUP_DIR="/var/lib/mysql/" ...


1

I have a little script for my MariaDb database inside a docker container. The setup is comparable. I have a database container with a mounted volume. Furthermore I have a second volume for backups mounted under /backup. The script is run on the host via cron and uses the database instance inside the container, so only one database accesses the data. That is ...


1

I'm still fairly new to the Docker game, too, but I've got a few little projects that I do exactly what you are asking about. Through my own experience with trial & error (mostly error...) I would suggest using a docker-compose.yml with your network set to static internal IPs so each container will have predictable, repeatable results and IPs that you ...


1

I think my case may be related as I also tried to configure environment for both Windows and Linux. I only have to mention that I am using docker-compose on WSL1 (Windows Subsystem for Linux) configured following by: this I suggest you to try My solution is (using the: long-syntax volumes definition from official docs): version: '3.7' services: web: ...


1

If I understand Docker Desktop and Hyper-V correctly, volumes are stored inside a MobyLinuxVM. That's right and it seems to be possible to move the whole VM to another drive as described here. Maybe you could solve you problem by using a volume driver as described in the official docs. Another approach is to use a Linux VM with Docker and tell your ...


1

The Problem: Named volumes are initialized on container creation when the volume is empty, and from the first container that starts up using that volume. That initialization includes all files, directories, and file metadata like owners and permissions. If there is content in the named volume, docker will not initialize it again since that would defeat the ...


1

By a "local volume" I assume you mean a block device directly attached to the host, such as a "normal" internal disk. The standard way to run multiple Docker, containers now is Kubernetes, since the demise of Docker Swarm. My reference here is the Kubernetes documentation for Persistent Volumes specifically the table on Access Modes, and the column for ...


Only top voted, non community-wiki answers of a minimum length are eligible