Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
alanprot committed Dec 14, 2022
1 parent 78e6da8 commit c7b6794
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/scripts/install-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ set -x
VER="20.10.19"
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
mkdir -vp ~/.docker/cli-plugins/
curl --silent -L "https://github.com/docker/buildx/releases/download/v0.3.0/buildx-v0.3.0.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
chmod a+x ~/.docker/cli-plugins/docker-buildx
mv /tmp/docker/* /usr/bin
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ SED ?= $(shell which gsed 2>/dev/null || which sed)
# Dependencies (i.e. things that go in the image) still need to be explicitly
# declared.
%/$(UPTODATE): %/Dockerfile
@echo
$(SUDO) docker build --build-arg=revision=$(GIT_REVISION) --build-arg=goproxyValue=$(GOPROXY_VALUE) -t $(IMAGE_PREFIX)$(shell basename $(@D)) -t $(IMAGE_PREFIX)$(shell basename $(@D)):$(IMAGE_TAG) $(@D)/
$(SUDO) docker buildx build --platform linux/amd64 --build-arg=revision=$(GIT_REVISION) --build-arg=goproxyValue=$(GOPROXY_VALUE) -t $(IMAGE_PREFIX)$(shell basename $(@D)) -t $(IMAGE_PREFIX)$(shell basename $(@D)):$(IMAGE_TAG) $(@D)/
$(SUDO) docker buildx build --platform linux/arm64 --build-arg=revision=$(GIT_REVISION) --build-arg=goproxyValue=$(GOPROXY_VALUE) -t $(IMAGE_PREFIX)$(shell basename $(@D)) -t $(IMAGE_PREFIX)$(shell basename $(@D)):$(IMAGE_TAG)-arm64 $(@D)/
@echo
@echo Please use push-multiarch-build-image to build and push build image for all supported architectures.
touch $@
Expand Down Expand Up @@ -275,13 +275,15 @@ save-images:
for image_name in $(IMAGE_NAMES); do \
if ! echo $$image_name | grep build; then \
docker save $$image_name:$(IMAGE_TAG) -o docker-images/$$(echo $$image_name | tr "/" _):$(IMAGE_TAG); \
docker save $$image_name:$(IMAGE_TAG)-arm64 -o docker-images/$$(echo $$image_name | tr "/" _):$(IMAGE_TAG)-arm64; \
fi \
done

load-images:
for image_name in $(IMAGE_NAMES); do \
if ! echo $$image_name | grep build; then \
docker load -i docker-images/$$(echo $$image_name | tr "/" _):$(IMAGE_TAG); \
docker load -i docker-images/$$(echo $$image_name | tr "/" _):$(IMAGE_TAG)-arm64; \
fi \
done

Expand Down
2 changes: 1 addition & 1 deletion cmd/cortex/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.14
FROM --platform=$BUILDPLATFORM alpine:3.14
RUN apk add --no-cache ca-certificates
COPY migrations /migrations/
COPY cortex /bin/cortex
Expand Down
2 changes: 1 addition & 1 deletion cmd/query-tee/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.14
FROM --platform=$BUILDPLATFORM alpine:3.14
RUN apk add --no-cache ca-certificates
COPY query-tee /
ENTRYPOINT ["/query-tee"]
Expand Down
2 changes: 1 addition & 1 deletion cmd/test-exporter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.14
FROM --platform=$BUILDPLATFORM alpine:3.14
RUN apk add --no-cache ca-certificates
COPY test-exporter /
ENTRYPOINT ["/test-exporter"]
Expand Down
2 changes: 1 addition & 1 deletion cmd/thanosconvert/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.14
FROM --platform=$BUILDPLATFORM alpine:3.14
RUN apk add --no-cache ca-certificates
COPY thanosconvert /
ENTRYPOINT ["/thanosconvert"]
Expand Down
8 changes: 5 additions & 3 deletions push-images
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ push_image() {

# remove the quay prefix and push to docker hub
docker_hub_image=${image#$QUAY_PREFIX}
docker tag ${image}:${IMAGE_TAG} ${docker_hub_image}:${IMAGE_TAG}
for arch in amd64 arm64; do \
docker tag ${image}:${IMAGE_TAG} ${docker_hub_image}:${IMAGE_TAG}-$arch

echo "Pushing ${docker_hub_image}:${IMAGE_TAG}"
docker push ${docker_hub_image}:${IMAGE_TAG}
echo "Pushing ${docker_hub_image}:${IMAGE_TAG}-$arch"
docker push ${docker_hub_image}:${IMAGE_TAG}-$arch
done;
}

for image in ${IMAGES}; do
Expand Down

0 comments on commit c7b6794

Please sign in to comment.