version: 0.2 # Based on the Docker documentation, must include the DOCKER_CLI_EXPERIMENTAL environment variable # https://docs.docker.com/engine/reference/commandline/manifest/ env: secrets-manager: DOCKERHUB_PASS: "/dockerhub/credentials:password" DOCKERHUB_USERNAME: "/dockerhub/credentials:username" phases: install: commands: - yum update -y pre_build: commands: - echo Logging in to DOCKER... - docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASS build: commands: - echo Build started on `date` - echo Building the Docker manifest... - export DOCKER_CLI_EXPERIMENTAL=enabled - docker manifest create $IMAGE_REPO_NAME $IMAGE_REPO_NAME:latest-arm64 $IMAGE_REPO_NAME:latest-amd64 - docker manifest annotate --arch arm64 $IMAGE_REPO_NAME $IMAGE_REPO_NAME:latest-arm64 - docker manifest annotate --arch amd64 $IMAGE_REPO_NAME $IMAGE_REPO_NAME:latest-amd64 post_build: commands: - echo Build completed on `date` - echo Pushing the Docker image... - docker manifest push $IMAGE_REPO_NAME - docker manifest inspect $IMAGE_REPO_NAME