Skip to content

Commit

Permalink
cleanup dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Jan 2, 2024
1 parent 4b90eae commit 7248c03
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ ENV GO111MODULE=on
RUN apk update && \
apk add bash jq alpine-sdk sed gawk git ca-certificates curl mc && \
apk add --no-cache gcc musl-dev
RUN go install honnef.co/go/tools/cmd/staticcheck@v0.4.2 && \
go install github.com/rakyll/statik@v0.1.7 && \
go install github.com/golang/mock/mockgen@v1.6.0 && \
go install github.com/go-swagger/go-swagger/cmd/swagger@v0.30.2

WORKDIR /app

Expand All @@ -19,17 +15,10 @@ RUN go mod download
# Copy project code
COPY . /app

# lint and unit tests
RUN staticcheck ./... && \
go vet ./... && \
CGO_ENABLED=0 GOOS=linux go test ./...

RUN addgroup -S -g 1000 radix && adduser -S -u 1000 -G radix radix

# Build
RUN swagger generate client -t ./generated-client -f https://api.radix.equinor.com/swaggerui/swagger.json -A radixapi && \
go mod tidy && \
CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -a -installsuffix cgo -o ./rootfs/rx
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -a -installsuffix cgo -o ./rootfs/rx

## Run operator
FROM scratch
Expand Down

0 comments on commit 7248c03

Please sign in to comment.