Quick Start
Learn how to create a multi-arch image.
Prerequisites
- An installation of Docker Engine
- Access to a container registry (i.e. DockerHub or some other private registry)
Install the latest version of Tugboat
Use the provided bash installation script to install the latest version of Tugboat.
curl -sSL https://get.gotugboat.io | bash
Note: For all installation options visit the install documentation
Build an image
Before creating our example image, we should export the credentials required to access the container registry and specify the architectures on which our image will be supported.
export REGISTRY_USER="username"
export REGISTRY_PASSWORD="password"
export IMAGE_SUPPORTED_ARCHITECTURES="amd64,arm64"
Once our credentials are loaded, the following example demonstrates how to build and push the image to DockerHub. This step should be executed on a machine corresponding to each architecture you intend to support. The example below assumes you are building on an amd64 system.
tugboat build -t gotugboat/my-image:v1.0.0 --push
Resulting image:
docker.io/gotugboat/my-image:amd64-v1.0.0
Tag an image
With a built image pushed onto the registry, we can give it additional reference tags. Utilizing the --push flag, like in
this example, will push the locally generated tags to your remote registry after they are created.
tugboat tag gotugboat/my-image:v1.0.0 --tags latest --push
Resulting tags:
docker.io/gotugboat/my-image:amd64-latestdocker.io/gotugboat/my-image:arm64-latest
Note: This assumes that you ran the
tugboat buildcommand on both an amd64 and arm64 system.
Create the manifests
Tugboat creates all images with an architecture prepended to the given tag. This is how tugboat knows which image to pull when generating the manifests for your given tags.
tugboat manifest create gotugboat/my-image --for v1.0.0,latest --push
Resulting manifests lists:
docker.io/gotugboat/my-image:v1.0.0docker.io/gotugboat/my-image:amd64-v1.0.0docker.io/gotugboat/my-image:arm64-v1.0.0
docker.io/gotugboat/my-image:latestdocker.io/gotugboat/my-image:amd64-latestdocker.io/gotugboat/my-image:arm64-latest