Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vašek <[email protected]>
  • Loading branch information
matejvasek committed Mar 25, 2024
1 parent ed05446 commit 1a073a8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build-images.yaml
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"
21 changes: 21 additions & 0 deletions Dockerfile.utils
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

0 comments on commit 1a073a8

Please sign in to comment.