Skip to content

Commit

Permalink
chore: update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood committed Aug 29, 2024
1 parent b77bd1d commit 1d5e29f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
ARG MTK_VERSION

# build MTK from source
FROM golang:1.18-alpine as builder
FROM golang:1.22-alpine as builder

WORKDIR /go/src/github.com/skpr
RUN apk add --virtual --update-cache git && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*
RUN git clone https://github.com/skpr/mtk.git && cd mtk && git checkout $MTK_VERSION
WORKDIR /go/src/github.com/skpr/mtk/dump
ADD https://github.com/skpr/mtk.git#$MTK_VERSION ./mtk

WORKDIR /go/src/github.com/skpr/mtk

# compile
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o bin/mtk-dump github.com/skpr/mtk/dump
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o bin/mtk-dump github.com/skpr/mtk/cmd/mtk

ARG IMAGE_REPO
FROM ${IMAGE_REPO:-uselagoon}/commons as commons

# Put in some labels so people know what this image is for
LABEL org.opencontainers.image.authors="The Lagoon Authors" maintainer="The Lagoon Authors"

COPY --from=builder /go/src/github.com/skpr/mtk/dump/bin/mtk-dump /usr/local/bin/mtk-dump
COPY --from=builder /go/src/github.com/skpr/mtk/bin/mtk-dump /usr/local/bin/mtk-dump

# Install necessary packages
# - perl for docker-login
Expand Down

0 comments on commit 1d5e29f

Please sign in to comment.