Skip to content

Commit 76744bb

Browse files
authored
Add tsh in compile-image stage (#203)
1 parent afea272 commit 76744bb

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ WORKDIR /sources
1212
RUN wget -q -O terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip \
1313
&& unzip terraform.zip -d /usr/local/bin \
1414
&& rm -rf terraform.zip
15+
# Install tsh (Teleport CLI) for tests
16+
ARG TELEPORT_VERSION="18.6.5"
17+
RUN case ${TARGETARCH} in \
18+
amd64) ARCH=amd64 ;; \
19+
arm64) ARCH=arm64 ;; \
20+
*) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \
21+
esac \
22+
&& wget -q https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION}-linux-${ARCH}-bin.tar.gz -O - | tar -xz \
23+
&& mv teleport/tsh /usr/local/bin/tsh \
24+
&& chmod +x /usr/local/bin/tsh \
25+
&& rm -rf teleport
1526
RUN apk add --virtual=build bash gcc libffi-dev musl-dev openssl-dev make git
1627
RUN ln -s /usr/local/bin/python /usr/bin/python
1728
RUN pip --no-cache-dir install virtualenv \
@@ -72,6 +83,9 @@ RUN wget -q https://amazon-eks.s3-us-west-2.amazonaws.com/${AWS_IAM_AUTHENTICATO
7283
RUN wget -q https://github.com/helmfile/helmfile/releases/download/v${HELM_FILE_VERSION}/helmfile_${HELM_FILE_VERSION}_linux_${TARGETARCH}.tar.gz -O - | tar -xzO helmfile > /usr/local/bin/helmfile \
7384
&& chmod +x /usr/local/bin/helmfile
7485

86+
# Copy tsh from compile-image stage (optional - only needed if you want tsh in final image)
87+
COPY --from=compile-image /usr/local/bin/tsh /usr/local/bin/tsh
88+
7589
# install utils under `ops` user
7690
USER ops
7791
ENV HOME=/home/ops

0 commit comments

Comments
 (0)