docker-platformify

command module
v0.0.0-...-d923c4b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

README

Docker Platform-ify

Proxies the Docker API socket and injects a custom platform parameter whenever an image is pulled/created.

Screenshot

Warning

Industrial grade duct-tape!

duct tape duct tape

Usage

Since executables built for another architecture won't magically run on your machine on their own, you're gonna have to install qemu-user-static and ensure binfmt_misc is configured correctly, for example:

:qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64-static:CF

Also, Docker needs to be started with the --experimental flag.

Note that this is equivalent to adding --platform yourvalue to the docker pull/ docker run commands, it just does it transparently. My use case is a CI runner that connects to Docker using the API without the command line.

Building
go build
Running
./docker-platformify /var/run/docker.sock /tmp/injected.sock linux/arm64
Change log level
./docker-platformify /var/run/docker.sock /tmp/injected.sock linux/arm64 DEBUG

License

GNU GPLv3.0

Please share your changes if you end up deploying this piece of duct tape on your premises :)

gif

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL