teleport/build.assets/charts/Dockerfile-distroless
Trent Clarke a992e6fded
Distroless dockerfile and smoke tests for same (#21860)
* Distroless dockerfile and smoke tests for same

This patch adds a Dockerfile to `build.assets/charts` that will construct
a docker image for teleport based on the Distroless Debian images
published by Google. The actual workflows used to construct and publish
these images are defined in `teleport.e` for security reasons.

The Smoke Testing framework exists to make some quick assertions about
the resulting images: will Teleport even start in this context, etc. See
the included README for more details.

* Update README.md

* Linter appeasement

* Revert spurious submodule update

* Rename release component var

* Smoke test docs

* Smoke test docs

* Revert spurious subrepo update
2023-03-02 09:51:28 +00:00

25 lines
1 KiB
Plaintext

ARG BASE_IMAGE=gcr.io/distroless/cc-debian11
FROM debian:11 AS staging
RUN apt-get update
COPY fetch-debs ./
RUN ./fetch-debs dumb-init libpam0g libaudit1 libcap-ng0
FROM debian:11 AS teleport
# NOTE that the TELEPORT_RELEASE_INFIX *must* include the leading dash if set
ARG TELEPORT_RELEASE_INFIX
ARG TELEPORT_VERSION
ARG TARGETARCH
ENV TELEPORT_DEB_FILE_NAME=teleport${TELEPORT_RELEASE_INFIX}_${TELEPORT_VERSION}_${TARGETARCH}.deb
COPY $TELEPORT_DEB_FILE_NAME ./$TELEPORT_DEB_FILE_NAME
RUN dpkg-deb -R $TELEPORT_DEB_FILE_NAME /opt/staging && \
mkdir -p /opt/staging/etc/teleport && \
mkdir -p /opt/staging/var/lib/dpkg/status.d/ && \
mv /opt/staging/DEBIAN/control /opt/staging/var/lib/dpkg/status.d/teleport && \
rm -rf /opt/staging/DEBIAN
FROM $BASE_IMAGE
COPY --from=teleport /opt/staging /
COPY --from=staging /opt/staging/root /
COPY --from=staging /opt/staging/status /var/lib/dpkg/status.d
ENTRYPOINT ["/usr/bin/dumb-init", "/usr/local/bin/teleport", "start", "-c", "/etc/teleport/teleport.yaml"]