Defence Against the Docker Arts
blog.heroku.com
Defence Against the Docker Arts
1–10 of 103 posts
Re: Defence Against the Docker Arts
#2Re: Defence Against the Docker Arts
#3 FROM node:10 AS build
WORKDIR /foo
COPY . .
RUN npm i
RUN npx webpack
FROM nginx:whatever
COPY nginx.conf /etc/nginx/config.d/
COPY --from=build /foo/dist /srv
...
It's fine when you have one. Annoying when you have a couple. This isn't code that needs to be checked into the repository and updated. It needs to just work.The other thing I'd like to see is the ability to output multiple containers from one Dockerfile. There is so much wasted work where I have webpack stuff and a go application that run in separate containers but are built together. There is one Dockerfile like the above to build the static part. There is another to build the go binary and copy it to an almost-pristine alpine container (including dumb-init, cacerts, tzdata, and grpc_health_probe). I don't understand why I have to have two Docker files to do that.
Re: Defence Against the Docker Arts
#4Re: Defence Against the Docker Arts
#5Re: Defence Against the Docker Arts
#6Vote me down, but oh god that title...
Re: Defence Against the Docker Arts
#7I've been very close to creating something like this internally. It is easy to write a Dockerfile that produces a compact and optimal container. But it's the same lines of code over and over again. Anything we have that's a static site looks like: FROM node:10 AS build WORKDIR /foo COPY . . RUN npm i RUN npx webpack FROM nginx:whatever COPY nginx.conf /etc/nginx/config.d/ COPY --from=build /foo/dist /srv ... It's fin…
Re: Defence Against the Docker Arts
#8If you want to scale in a pinch then it's a case of making some tiny tweaks and pushing to Heroku instead.
Re: Defence Against the Docker Arts
#9Buildpacks fit nicely into the heroku way of doing things. But at any medium to large sized engineering organization, there's no way they could satisfy the requirements for even a simple majority of services that using a Dockerfile provides.
Re: Defence Against the Docker Arts
#10Honestly after years of stagnation, the most exciting work on container building is now coming out of Docker. Buildkit is amazing, a real hidden gem.