-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (45 loc) · 1.44 KB
/
Dockerfile
File metadata and controls
56 lines (45 loc) · 1.44 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
ARG GO_VERSION=1.25
FROM --platform=$BUILDPLATFORM registry.opensuse.org/opensuse/bci/golang:${GO_VERSION} AS builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /work
# Add specific dirs to the image so cache is not invalidated when modifying non go files
ADD go.mod .
ADD go.sum .
RUN go mod download
ADD cmd cmd
ADD internal internal
ADD pkg pkg
ADD Makefile .
ADD .git .
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make all
FROM registry.opensuse.org/opensuse/tumbleweed:latest AS runner-base
ARG TARGETARCH
RUN ARCH=$(uname -m); \
[[ "${ARCH}" == "aarch64" ]] && ARCH="arm64"; \
zypper --non-interactive removerepo repo-update || true; \
zypper --non-interactive install --no-recommends xfsprogs \
util-linux-systemd \
e2fsprogs \
udev \
rsync \
grub2 \
dosfstools \
grub2-${ARCH}-efi \
mtools \
gptfdisk \
patterns-microos-selinux \
btrfsprogs \
btrfsmaintenance \
snapper \
lvm2 && \
zypper clean --all
COPY --from=builder /work/build/elemental3ctl /usr/bin/elemental3ctl
COPY --from=builder /work/build/elemental3 /usr/bin/elemental3
FROM runner-base AS runner-elemental3ctl
ENTRYPOINT ["/usr/bin/elemental3ctl"]
FROM runner-base AS runner-elemental3
RUN zypper --non-interactive removerepo repo-update || true; \
zypper --non-interactive install --no-recommends xorriso && \
zypper clean --all
ENTRYPOINT ["/usr/bin/elemental3"]