News for hackers. Stuff that matters.
Re:Docker's Second Death by m463 on Sunday December 06, 2020 @06:35PM (#25327742)
I have always wanted that too.

the way to create small docker image is:

  RUN apt-get install foo && \
    do bar && \
    do more && \
    remove all of the crap you don't want
It should be replaced with actual first-order dockerfile statements

You can use multi-stage builds, but they are sort of hacky and do not match your thinking.

You can also use --squash but it is a hack too and usually is not available where needed because of experimental.

Also, ADD is stupid.

You can add a tar.gz file and it will expand it (but you can't use -k)

You can add the same file using http/https, except it WON'T expand it so back to the RUN dilemma you get:

  RUN apt-get install wget && \
    wget foo.tar.gz && \
    tar xvkf foo.tar.gz -C dir && \
    rm foo.tar.gz

There are no comments on this comment yet.