-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (26 loc) · 1.01 KB
/
Dockerfile
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
29
30
31
32
33
34
35
FROM alpine:latest
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.title="GoTTY Docker"
LABEL org.opencontainers.image.description="A Docker image for GoTTY."
# This is the version of Gotty we're running
ARG GOTTY_RELEASE=gotty_v1.3.0_linux_amd64.tar.gz
# Create non-root ruser
ARG USER=gotty
RUN adduser -D $USER
WORKDIR /home/$USER
# Add dependencies
RUN apk add --update go git curl
# Install GoTTY
RUN mkdir -p /tmp/gotty
RUN GOPATH=/tmp/gotty go get github.com/sorenisanerd/gotty
RUN mv /tmp/gotty/bin/gotty /usr/local/bin/
# Install kubectl
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
RUN curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
RUN echo "$(cat kubectl.sha256) kubectl" | sha256sum -c
RUN chmod +x kubectl
RUN mv kubectl /usr/local/bin/kubectl
# Clean up
RUN apk del go git curl
RUN rm -rf /tmp/gotty /var/cache/apk/*
USER $USER