Skip to content

Commit

Permalink
Merge pull request #17 from uselagoon/testing/fix-mtk-quoting-1
Browse files Browse the repository at this point in the history
Allow to specify the version of MTK used to build the image
  • Loading branch information
shreddedbacon authored Nov 21, 2024
2 parents c26780d + 1304b2f commit 25c7eea
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- 'main'
- 'testing/**'
tags:
- 'v*.*.*'
pull_request:
Expand Down Expand Up @@ -54,3 +55,5 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
MTK_VERSION=$mtk_version
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
ARG MTK_VERSION

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

ENV MTK_VERSION=v2.0.2

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 0c133b920123f05404854f3aacf44f05e6d20e03
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=${ARCH} 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
10 changes: 9 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@
"matchDepTypes": ["action"],
"groupName": "GitHub actions"
}
],
"regexManagers": [
{
"fileMatch": ["(^|/|\\.)Dockerfile$"],
"matchStrings": ["ENV MTK_VERSION=(?<currentValue>.*?)\n"],
"depNameTemplate": "skpr/mtk",
"datasourceTemplate": "github-tags"
}
]
}
}

0 comments on commit 25c7eea

Please sign in to comment.