Sick of Being Stuck Trying to Do Things That Should BE Really Simple With Docker

Set up is – trying to cross-build a large Docker container.

Something like this seems to work with Github Actions:

docker buildx build --platform linux/amd64,linux/arm64             -t ouvocl/vce-tm351-monolith:SOME-HASH --push ./tm351-monolith

docker buildx build --platform linux/amd64,linux/arm64             -t ouvocl/vce-tm351-monolith:latest --push ./tm351-monolith

only it doesn’t because trying to cross-build several images at the same time seems to break the action (out of space?) With smaller images everythig is fine and the second build appears to just use the cached layers from the first build.

Trying to run the above commands locally doesn’t work: cacheing doesn’t seem to apply, so the build is executed twice, which takes ages. Also, if the built layers are different, the push takes double the time it should if we were just pusjing layers that had already been pushed. And the images aren’t necessarily identical, which they should be.

When pushing to Dockerhub, a manifest keeps track of tags and platforms. But trying to find docs that would give me a simple recipe for reliably:

  • cross-build images for two or more platforms;
  • tag and push images for each platform to Docker using eg a Github hash tag as a well as a latest tag;
  • update image for one platform and push that with a new Github hash tag and new latest tag without knackering the manifest.

I am sick to f****g death of trying to build images and containers and do the simplest of related image management tasks.

Author: Tony Hirst

I'm a Senior Lecturer at The Open University, with an interest in #opendata policy and practice, as well as general web tinkering...

%d bloggers like this: