-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (27 loc) · 784 Bytes
/
Dockerfile
File metadata and controls
39 lines (27 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM golang:1.25 AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG VERSION
ARG COMMIT
ARG DATE
RUN CGO_ENABLED=0 go build -ldflags "-s -w -X 'credo/version.Version=${VERSION}' -X 'credo/version.Commit=${COMMIT}' -X 'credo/version.BuildDate=${DATE}'" -o /usr/bin/credo .
FROM ubuntu:24.04 AS final
ENV \
DEBIAN_FRONTEND=noninteractive \
LANG="C.UTF-8"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -x \
&& apt-get update -yq --no-install-recommends \
&& apt-get install -yq --no-install-recommends \
build-essential \
gfortran \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
COPY --from=builder /usr/bin/credo /usr/bin/credo
RUN set -x \
&& chmod +x /usr/bin/credo \
&& mkdir -p /workdir
WORKDIR /workdir