Last active
October 3, 2022 10:17
-
-
Save w4/4272dede1b2d7ae7d92ed97a63ca1753 to your computer and use it in GitHub Desktop.
Download, build and install Teleport for Podman on ARM64 NixOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
{ | |
virtualisation.oci-containers.containers.teleport = { | |
image = "localhost/teleport:10.3.1"; | |
volumes = [ "/data/teleport/config:/etc/teleport.d" "/data/teleport/data:/var/lib/teleport" ]; | |
ports = [ "443:443" "3025:3025" "3024:3024" "3023:3023" ]; | |
autoStart = true; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG VERSION | |
FROM ubuntu AS download | |
ARG DEBIAN_FRONTEND=noninteractive | |
ARG VERSION | |
WORKDIR /tmp | |
RUN apt update && apt install -y curl | |
RUN curl -o teleport.tar.gz https://get.gravitational.com/teleport-v$VERSION-linux-arm64-bin.tar.gz \ | |
&& tar xvzf teleport.tar.gz | |
FROM ubuntu | |
ARG DEBIAN_FRONTEND=noninteractive | |
RUN apt update \ | |
&& apt install -y ca-certificates \ | |
dumb-init \ | |
libelf1 \ | |
&& update-ca-certificates \ | |
&& apt -y clean \ | |
&& rm -rf /var/lib/apt/lists/* | |
COPY --from=download /tmp/teleport/teleport /usr/local/bin/teleport | |
COPY --from=download /tmp/teleport/tctl /usr/local/bin/tctl | |
COPY --from=download /tmp/teleport/tsh /usr/local/bin/tsh | |
COPY --from=download /tmp/teleport/tbot /usr/local/bin/tbot | |
ENTRYPOINT ["/usr/bin/dumb-init", "teleport", "start", "-c", "/etc/teleport.d/teleport.yaml"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env nix-shell | |
#! nix-shell -i bash -p jq | |
LATEST=$(curl https://api.github.com/repos/gravitational/teleport/releases | jq '.[] | select(.prerelease == false and .draft == false) | .tag_name' | sed -En 's/^"v([0-9.]+)"$/\1/p' | sort -n | tail -n 1) | |
read -n 1 -p "Would you like to build Teleport $LATEST? [y/N] " ANSWER | |
echo "" | |
if [ "$ANSWER" != "y" ] && [ "$ANSWER" != "Y" ]; then | |
exit 1 | |
fi | |
podman build . --build-arg VERSION=$LATEST --tag=teleport:$LATEST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment