Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
hitko31454yDebugging docker is pretty straightforward. Every step creates a checkpoint you can run, just use "docker run -ti --rm <checkpoint> sh", then you can do whatever you want, manually try the next command to make sure you got everything right, etc.
-
@hitko Yes. No.
Fuckity.
Yes you could use eg docker run to execute an command inside the last generated docker image in the build stage.
No. It isn't as simple as that.
Debugging means a bit more explanation of what the docker commands do.
Eg when you work with a non root user, you have to use COPY --chown USER:GID .. as permissions get set to root otherwise.
Behaviour is fine, but it would be
helpful if that would be _visible_ in the output while running the command. I might have overlooked some verbose flag, but in general these are tiny papercuts that can drive someone insane.....
Another example...
Multi build stage - what is inherited in a sub stage? yes.i could look it up or analyze it by docker inspect <Image> -but a simple text output like "ENV, ARG, ENTRY POINT... inherited from XY" would make it obvious....
Very small things, but pretty nasty.
Fuckity as sometimes interacting with docker tools it self can be ...painful.
docker -f Dockerfile build .
docker build -f Dockerfile .
Which is correct...? ;)
All small tiny things...some maybe not fixable, yes.but the error output is most of the times really not helpful. -
Make sure that if you're trying what @hitko says that you're not running under buildkit.
Buildkit debugging is almost impossible, but builds are by and large much faster. -
eval6764yReally useful tool i wish id known earlier: dive.
Lets you see individual layers in an intuitive way
Related Rants
Today I experimented a bit with Dockerfile's.
Was quite surprised how far you could go with a spicy salsa of ARG, ENV, SHELL and multi stage builds.
But... For fucks sake....the debugging is like poking a light year long rod into a black hole, trying to fish something out of the event horizon....
In the end I got a nice setup for Java build's, version injectable with ENV/ARG, non root user and version specific behaviour.
As the debugging is non existing...
I filled up more than once my SSD....
It was an annoying brain damaged repetitive cycle of changing Dockerfile, pruning all images if docker build stopped because of missing free space, waiting for all stages to complete, start new.
And caching is a fragile thing that puzzles me .........
Guess more fishing tomorrow.
*Gives a happy deep throat to the beer bottle in hope of death*
rant
docker
the mother lode