Skip to content

Commit

Permalink
Update client Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pomo-mondreganto committed Nov 10, 2024
1 parent 42068c1 commit cae7cfc
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions client_env/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM golang:1.21 as build
FROM golang:1.23-alpine AS build

ENV CGO_ENABLED=0

RUN apk add upx

WORKDIR /app
COPY go.* ./
COPY cmd cmd
Expand All @@ -10,18 +12,19 @@ COPY pkg pkg
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
go build \
-trimpath \
-ldflags="-s -w" \
-o client \
cmd/client/main.go

RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
cmd/client/main.go && \
go build \
-trimpath \
-ldflags="-s -w" \
-o reaper \
cmd/reaper/main.go
cmd/reaper/main.go && \
upx --lzma -9 client && \
upx --lzma -9 reaper

FROM ubuntu:jammy as image-full
FROM ubuntu:24.04 AS image-full

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down Expand Up @@ -66,15 +69,15 @@ RUN chmod +x /entrypoint.sh
WORKDIR /work
ENTRYPOINT ["/entrypoint.sh"]

FROM image-full as image-full-sage
FROM image-full AS image-full-sage

RUN --mount=type=cache,sharing=private,target=/var/cache/apt \
apt-get update && \
apt-get install -y \
sagemath && \
rm -rf /var/lib/apt/lists/*

FROM alpine:3.16 as image-light
FROM alpine:3.20 AS image-light

RUN apk add bash dbus

Expand Down

0 comments on commit cae7cfc

Please sign in to comment.