Docker & Podman
Run containers
Load environment variables directly into containers:
docker run -it --env-file <(novops load -f dotenv -e dev) alpine sh
podman run -it --env-file <(novops load -f dotenv -e dev) alpine sh
novops load -f dotenv
generates an env file output compatible with Docker and Podman.
Compose
Use Docker Compose, podman-compose or another tool compatible with Compose Spec
Generate a .env
file
novops load -s .env
And use it on Compose file
services:
web:
image: 'webapp:v1.5'
env_file: .env
Build images
Include novops
in your Dockerfile such a:
# Multi-stage build to copy novops binary from existing image
FROM crafteo/novops:0.7.0 AS novops
# Final image where novops is copied
FROM alpine AS app
COPY --from=novops /novops /usr/local/bin/novops