diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..df9bd4c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# syntax=docker/dockerfile:1.1-experimental + +FROM --platform=${BUILDPLATFORM} docker.io/tonistiigi/xx:golang AS xx +FROM --platform=${BUILDPLATFORM} golang:alpine AS gobuild + +RUN apk add make + +WORKDIR /src + +COPY --from=xx / / +ARG TARGETPLATFORM +RUN --mount=target=. \ + --mount=type=cache,target=/go/pkg \ + --mount=type=cache,target=/root/.cache \ + make DEST=/out mobynit hostapp.test + + +FROM scratch AS final +COPY --from=gobuild /out/* / diff --git a/build-docker.sh b/build-docker.sh new file mode 100644 index 0000000..146d033 --- /dev/null +++ b/build-docker.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -ex + +mkdir -p "${HERE}"/deploy || true + +DOCKER_BUILDKIT=1 \ +docker build \ + --target=final \ + --platform=linux/amd64 \ + --output="${HERE}"/deploy \ + "${HERE}" diff --git a/repo.yml b/repo.yml new file mode 100644 index 0000000..1f7f59a --- /dev/null +++ b/repo.yml @@ -0,0 +1,2 @@ +type: build-in-container +reviewers: 1