hexops / dockerfile Goto Github PK
View Code? Open in Web Editor NEWDockerfile best-practices for writing production-worthy Docker images.
License: Other
Dockerfile best-practices for writing production-worthy Docker images.
License: Other
This docker cmd
RUN addgroup -g 10001 -S nonroot && adduser -u 10000 -S -G nonroot -h /home/nonroot nonroot
does not work for Ubuntu based images.
Got error like:
> [stage-1 5/9] RUN addgroup -g 10001 -S nonroot && adduser -u 10000 -S -G nonroot -h /home/nonroot nonroot:
#9 0.427 Option g is ambiguous (gecos, gid, group)
#9 0.427 Option s is ambiguous (shell, system)
addgroup
on Ubuntu desktop doesn't have same arguments like the ones provided in the docker file
Replaced it with:
RUN groupadd --gid 10001 nonroot && \
useradd --home-dir /home/nonroot \
--shell /bin/bash \
--create-home
--gid nonroot \
--groups nonroot \
--uid 10000 nonroot
Please let me know if I got the mapping right. I don't know what -S
argument represents in your cmd
A topic on multi-stage builds?
The problem is in this line:
- [Is `tini` still required in 2020? I thought Docker added it natively?](is-tini-still-required-in-2020-i-thought-docker-added-it-natively)
There is a missing #
- [Is `tini` still required in 2020? I thought Docker added it natively?](#is-tini-still-required-in-2020-i-thought-docker-added-it-natively)
It might not be a big thing but I suggest to fix the spellings in the bellow sentences.
priviledge --> privilege
host priviledge escalation could occur
because if someone does manage to escalate priviledges outside the Docker container
Hi, first of all I would like to say thank you so much for creating this awesome repo.
But sorry, I misunderstood two steps which are
Thanks for understanding.
I presume this was intended to be “ergonomically”. Although my brain initially skimmed it as “erroneously”.
The repository currently doesn't seem to contain any license. Could you add one, please? See Choose a License for more information 🙂
Try building static
binaries for you app and use minimalist base image, like Distroless:
https://github.com/GoogleContainerTools/distroless
I’m interested in your thoughts on building images for platforms like Red Hat OpenShift, which override the UID/GID of the image when a container is run (using an unpredictable, high UID). This adds security, but causes problems with file permissions unless the image author builds in permission fixes.
I haven’t found a simple to implement, general best practice that works with these platforms... it’s usually some hacky chmod script acting on application specific folders/files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.