From b1728c347470e3939af7fce88ce1885dbd2a8eea Mon Sep 17 00:00:00 2001 From: 9seconds Date: Wed, 11 Feb 2026 09:41:00 +0100 Subject: [PATCH] Add task for building image --- .mise.toml | 5 +++++ Dockerfile | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.mise.toml b/.mise.toml index 3de44f6..ce3ab2f 100644 --- a/.mise.toml +++ b/.mise.toml @@ -33,6 +33,11 @@ run = [ "rm ./dist/config.yaml" ] +[tasks.image] +description = "Build docker image" +sources = ["**/*.go", "go.mod", "go.sum", "Dockerfile"] +run = "docker buildx build --pull -t mtg ." + [tasks.docs] description = "Run doc server" tools."go:golang.org/x/pkgsite/cmd/pkgsite" = "latest" diff --git a/Dockerfile b/Dockerfile index 86c5b49..c2e90e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,24 @@ ############################################################################### # BUILD STAGE -FROM golang:1.19-alpine AS build +FROM alpine:3 AS build + +ENV CGO_ENABLED=0 +ENV GOOS=linux RUN set -x \ && apk --no-cache --update add \ bash \ ca-certificates \ - curl \ git \ - make + mise COPY . /app WORKDIR /app RUN set -x \ - && make -j 4 static + && mise trust \ + && mise tasks run static ###############################################################################