You should consider how well organized is the development and production environment. The current project suffers from the same organization issues, and containers are used to minimize them.
Compose
Dockerfile is a special file for creating container images, but lacks a mechanism into running them. There is where docker-compose comes in play, it configures how images are executed, which volumes, networks and so on.
Problem
must have 2 different environments, development and production
in both environments, the user should easily pass configuration files, ssh private keys and so on, through volumes
have 2 sub-projects, Ansible and Juniper
There are total of 4 environments.
I managed to solve this using docker-compose. For example, the following is the docker-compose configuration of juniper found juniper/docker-compose.yaml:
All these paths are hard-coded because all them references this very project. You can add custom volumes from the top level docker-compose.yaml, like in the docker-compose.yaml.example:
The extends keyword allows to create user-defined docker-compose configurations, so the file ./juniper/docker-compose.yaml keeps untouched.
Using this concept, you should be able to create all 4 environment just extending each from the one provided by the developer, overriding the volumes with the required files/directories, and all this as a user configuration file.
Description
You should consider how well organized is the development and production environment. The current project suffers from the same organization issues, and containers are used to minimize them.
Compose
Dockerfile
is a special file for creating container images, but lacks a mechanism into running them. There is wheredocker-compose
comes in play, it configures how images are executed, which volumes, networks and so on.Problem
There are total of 4 environments.
I managed to solve this using
docker-compose
. For example, the following is the docker-compose configuration of juniper found juniper/docker-compose.yaml:All these paths are hard-coded because all them references this very project. You can add custom volumes from the top level
docker-compose.yaml
, like in the docker-compose.yaml.example:Note: truncated content for brevity
The
extends
keyword allows to create user-defineddocker-compose
configurations, so the file./juniper/docker-compose.yaml
keeps untouched. Using this concept, you should be able to create all 4 environment just extending each from the one provided by the developer, overriding the volumes with the required files/directories, and all this as a user configuration file.