summaryrefslogtreecommitdiff
path: root/buildpush.sh
blob: 42f8e644c4859241f0bbddc23133c0f4c3c02f43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash -e

# Builds distroless Docker images with the application and pushes them to Docker Hub
# Currently, intended to be run from a local machine

APP_NAME="hello_world"
DOCKER_HUB="YourDockerHubUsername"

# Step 1: Build the Docker image and push to Docker Hub
# This builds and pushes ARM32, ARM64, and X64 images
docker buildx create --use --name mybuilder || true
docker buildx use mybuilder
docker buildx inspect --bootstrap
docker buildx build . --platform linux/amd64,linux/arm64,linux/arm/v7 -t $DOCKER_HUB/$APP_NAME:latest --push