-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Matej Vašek <[email protected]>
- Loading branch information
1 parent
ed05446
commit 1a073a8
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Build Images | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
name: Build job | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/composite/go-setup | ||
- name: Install uuid | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install uuid | ||
- name: Build Util Image | ||
run: | | ||
docker buildx create --name multiarch --driver docker-container --use | ||
docker buildx build . -f Dockerfile.utils \ | ||
--platform=linux/ppc64le,linux/s390x,linux/amd64,linux/arm64 \ | ||
--push \ | ||
-t "ttl.sh/knative/func-util-$(uuid):2h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM --platform=$BUILDPLATFORM index.docker.io/library/golang:1.22.1-alpine3.19 AS builder | ||
|
||
ARG BUILDPLATFORM | ||
ARG TARGETPLATFORM | ||
ARG TARGETARCH | ||
|
||
COPY . . | ||
|
||
RUN GOARCH=$TARGETARCH go build -o deploy -trimpath -ldflags '-w -s' ./cmd/func-deployer | ||
|
||
######################### | ||
|
||
FROM --platform=$TARGETPLATFORM index.docker.io/library/alpine:latest | ||
|
||
RUN apk add --no-cache socat tar \ | ||
&& addgroup func -g 1000 \ | ||
&& adduser func -u 1001 -D -G func | ||
|
||
COPY --from=builder /go/deploy /usr/local/bin/ | ||
|
||
USER func:func |