Hot answers tagged

5

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 ...


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

Yes. Just use ./ for you current directory that the Docker-compose file is in. Docker-Compose does not allow you to use a context that is located above the compose file, so everything the compose file will use is below the folder with the .yml. Your "working directory" for the compose file is just "./". If you are trying to set a directory below that it ...


2

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

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:...


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"


1

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

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

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

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