forked from mgoltzsche/podman-static
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-remote
28 lines (26 loc) · 1.23 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.14-alpine3.12 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 libselinux-dev ostree-dev openssl iptables bash \
go-md2man
RUN git clone 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=v2.2.1
RUN git clone --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.12
COPY --from=podman-remote /usr/local/bin /usr/local/bin
RUN adduser -D podman-remote -h /podman -u 1000
USER podman-remote:podman-remote