forked from mgoltzsche/podman-static
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-remote
28 lines (26 loc) · 1.34 KB
/
Dockerfile-remote
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
# podman build base
FROM golang:1.18-alpine3.15 AS podmanbuildbase
RUN apk add --update --no-cache git make gcc pkgconf musl-dev \
btrfs-progs btrfs-progs-dev libassuan-dev lvm2-dev device-mapper \
glib-static libc-dev gpgme-dev protobuf-dev protobuf-c-dev \
libseccomp-dev libseccomp-static libselinux-dev ostree-dev openssl iptables \
bash go-md2man
ARG BATS_VERSION=v1.7.0
RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch ${BATS_VERSION} https://github.com/bats-core/bats-core.git && cd bats-core && ./install.sh /usr/local
# podman remote
FROM podmanbuildbase AS podman-remote
RUN apk add --update --no-cache curl
ARG PODMAN_VERSION=v4.3.1
RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch ${PODMAN_VERSION} https://github.com/containers/podman src/github.com/containers/podman
WORKDIR $GOPATH/src/github.com/containers/podman
RUN make install.tools
RUN set -eux; \
make bin/podman-remote LDFLAGS_PODMAN="-s -w -extldflags '-static'"; \
mv bin/podman-remote /usr/local/bin/podman-remote; \
ln -s podman-remote /usr/local/bin/podman; \
ln -s podman-remote /usr/local/bin/docker; \
podman --help >/dev/null; \
[ "$(ldd /usr/local/bin/podman-remote | wc -l)" -eq 0 ] || (ldd /usr/local/bin/podman-remote; false)
FROM alpine:3.15
COPY --from=podman-remote /usr/local/bin /usr/local/bin
RUN adduser -D podman-remote -h /podman -u 1000