LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Containers (https://www.linuxquestions.org/questions/linux-containers-122/)
-   -   Problem using docker-compose and volumes (https://www.linuxquestions.org/questions/linux-containers-122/problem-using-docker-compose-and-volumes-4175726301/)

Buttersack 06-24-2023 03:32 PM

Problem using docker-compose and volumes
 
Hello,

i'm fairly new to Docker and run into troubles where i can't get myself out.

I'd like to create an image from scratch (already have a working Dockerfile). The build get's one parameter, the version of the software i would like to install inside the image. The version is also used as tag for the resulting image.

The configuration should be kept outside of the container in a separate volume. I'd like to prepopulate the volumes contents (files) and then mount it to the container.

I've used "docker volume create ..." for this but the container build by my docker-compose.yaml file seems to always create an own volume, instead of using my pre-created one. The docker-compose volume is named <name of compose script>_<name of my precreated volume>

dugan 06-25-2023 05:32 PM

Did you set "external: true" on the volume?


All times are GMT -5. The time now is 12:51 AM.