Simplify Your .env Files – One Variable at a Time! Modify variables upon an env file.
2.2K
__ __ _ _____ _
| \/ | | | __ \ | |
| \ / | | _| | | | ___ | |_ ___ _ ____ __
| |\/| | |/ / | | |/ _ \| __/ _ \ '_ \ \ / /
| | | | <| |__| | (_) | || __/ | | \ V /
|_| |_|_|\_\_____/ \___/ \__\___|_| |_|\_/
Simplify Your .env Files – One Variable at a Time!
MkDotenv is a lightweight and efficient tool for managing your .env files. Whether you're adding, updating, or replacing environment variables, MkDotenv makes it easy and hassle-free.
You can use it as stage upon your Dockerfile, for example:
FROM pcmagas/mkdotenv AS mkdotenv
FROM debian
COPY --from=mkdotenv /usr/bin/mkdotenv /bin/mkdotenv
Or alpine based images:
FROM pcmagas/mkdotenv AS mkdotenv
FROM alpine
COPY --from=mkdotenv /usr/bin/mkdotenv /bin/mkdotenv
Or temporaly mounting it on a run command:
RUN --mount=type=bind,from=pcmagas/mkdotenv:latest,source=/usr/bin/mkdotenv,target=/bin/mkdotenv \
mkdotenv --version
You can also run it as stanalone image as well:
docker run pcmagas/mkdotenv mkdotenv --version
If you want to manipulate a .env file using the docker image. You can use it like this:
cat .env | docker run -i pcmagas/mkdotenv mkdotenv Hello BAKA > .env.new
Or if you want multiple variables:
cat .env | docker run -i pcmagas/mkdotenv mkdotenv Hello BAKA | docker run -i pcmagas/mkdotenv mkdotenv BIG BROTHER > .env.new
Keep in mind to use the -i argument upon docker command that enables to read the input via the pipes. If ommited the mkdotenv command residing inside the container will not be able to read the contents of .env file piped to it.
If running the pcmagas/mkdotenv image as is the arguments --env-file,--input-file and --input-file will result an unsucessfull execution of mkdotenv.
If a .env file needs to be manipulated either pipe the ouitputs as shown upon examples above or extend the pcmagas/mkdotenv using a your own Dockerfile providing a nessesary volume:
FROM `pcmagas/mkdotenv`
RUN mkdir app
VOLUME app
These do not apply if following the instructions shown into Upon Image building section.
No volumes are provided with this image, also no ports are exposed with docker image as well.
In order to see what arguments provided run:
docker run pcmagas/mkdotenv mkdotenv --version
Content type
Image
Digest
sha256:d71c1cd6f…
Size
2.1 MB
Last updated
5 months ago
docker pull pcmagas/mkdotenv