To simplify human understanding and tooling, we need to establish some path conventions for our containers.
Assumptions / considerations
- Only run a single service per container
- Prioritize keeping things simple. Don't require path templating by service name.
- Downside: Makes it harder to reuse scripts outside of containers.
Paths
Service Code
Where the service's code will live.
- /srv/service -- Follows srv convention.
- /opt/service (used currently in service-runner-based Dockerfiles)
- /src -- Fairly common in other containers.
- /srv -- Standard location for site-specific data.
Entry Point
Regular service startup executable or script.
Proposals:
- /bin/run_service
- /bin/docker_entrypoint
- /docker_entrypoint
Test Entry Point
Run tests in container
- /bin/run_tests
Data
Data directories. Typically externally mounted volumes.
- /data -- Fairly common in docker containers.
Configuration files
Read-only, often from Kubernetes config maps.
- /conf -- Common in docker containers.
- /etc/service -- Follows etc convention.