Skip to content

Commit

Permalink
kaniko platform
Browse files Browse the repository at this point in the history
  • Loading branch information
arttor committed Apr 24, 2024
1 parent d45fa35 commit 04239d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21 as builder
FROM --platform=$BUILDPLATFORM golang:1.21 as builder
ARG GIT_COMMIT='not set'
ARG GIT_TAG=development
ENV GIT_COMMIT=$GIT_COMMIT
Expand All @@ -16,13 +16,14 @@ COPY . .
ARG GOOS=linux
# amd64| arm64
ARG GOARCH=amd64
ENV GOARCH=$GOARCH
# worker|proxy|agent
ARG SERVICE=worker

RUN CGO_ENABLED=0 GO111MODULE=on GOOS=$GOOS GOARCH=$GOARCH go build -ldflags="-X 'main.version=$GIT_TAG' -X 'main.commit=$GIT_COMMIT'" -o chorus ./cmd/${SERVICE}

# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
FROM --platform=$TARGETPLATFORM gcr.io/distroless/static:nonroot
USER nonroot:nonroot
WORKDIR /bin

Expand Down
4 changes: 4 additions & 0 deletions cmd/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package main
import (
"context"
"flag"
"fmt"
"os"
"os/signal"
"runtime"
"syscall"

"github.com/clyso/chorus/pkg/config"
Expand Down Expand Up @@ -48,6 +50,8 @@ func main() {
if configOverridePath != nil && *configOverridePath != "" {
configs = append(configs, config.Path(*configOverridePath))
}
fmt.Println(runtime.GOARCH)
fmt.Println(runtime.GOOS)

ctx, cancel := context.WithCancel(context.Background())
signals := make(chan os.Signal, 1)
Expand Down

0 comments on commit 04239d5

Please sign in to comment.