Compare commits

...

2 Commits

Author SHA1 Message Date
Bel LaPointe
cf779e45f5 base alpine for shell over scratch 2023-12-12 08:59:50 -07:00
Bel LaPointe
7ecfae3229 docker build.sh teeny 4mb img woo 2023-12-12 08:47:39 -07:00
2 changed files with 19 additions and 0 deletions

11
Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
FROM golang:1.21-bullseye as builder
COPY . /go/src/app
WORKDIR /go/src/app
RUN GOOS=linux CGO_ENABLED=0 go build -o /bin/app -a -installsuffix cgo -trimpath -ldflags "-s -w" -tags musl
FROM alpine
RUN apk update && apk --no-cache upgrade
COPY --from=builder /bin/app /bin/
CMD []
ENTRYPOINT ["/bin/app"]

8
build.sh Normal file
View File

@@ -0,0 +1,8 @@
#! /bin/bash
set -euo pipefail
docker rmi k3d-test:5001/gitea/echo-server:latest || true
docker build -t k3d-test:5001/gitea/echo-server:latest .
docker images | grep k3d-test:5001/gitea/echo-server
docker push k3d-test:5001/gitea/echo-server:latest