Building the Image
The following bash script makes it easier to build your custom image. Open the build script in a text editor and copy the following code:
#!/bin/bash
DOCKER_CONTAINER_NAME=carmen-worker
BASEPATH=$(dirname "$(realpath "$0")")
DOCKER_REPOSITORY=public.ecr.aws/arcloud/carmen-worker
if [[ "$1" = "arm64" ]];
then
ARCHITECTURE=arm64
PLATFORM=linux/arm64
else
ARCHITECTURE=x86-64
PLATFORM=linux/amd64
fi
echo Building $ARCHITECTURE version of $DOCKER_CONTAINER_NAME
docker buildx build --load --platform $PLATFORM --build-arg repository=$DOCKER_REPOSITORY --build-arg architecture=$ARCHITECTURE -t $DOCKER_CONTAINER_NAME $BASEPATH
The script excepts a single command line argument, the architecture to build for: x86-64 or arm64.
Run it with your desired architecture:
./build x86-64