kube-deployer/Dockerfile

40 lines
1.2 KiB
Docker
Raw Normal View History

FROM alpine:3@sha256:b89d9c93e9ed3597455c90a0b88a8bbb5cb7188438f70953fede212a0c4394e0
2024-05-15 17:14:46 +00:00
ARG SOPS_VERSION
ARG KUSTOMIZE_SOPS_VERSION
2024-05-17 17:12:34 +00:00
# Install dependencies
RUN apk add --no-cache \
kubectl \
kustomize \
age \
git \
bash \
openssh \
openrc \
ca-certificates \
make
# Install sops
2024-05-15 17:14:46 +00:00
ADD https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v3.8.1.linux.amd64 /tmp/sops
2024-05-17 17:12:34 +00:00
RUN mv /tmp/sops /usr/local/bin/sops && chmod +x /usr/local/bin/sops
# Install ksops
2024-05-15 17:14:46 +00:00
ADD https://github.com/viaduct-ai/kustomize-sops/releases/download/v${KUSTOMIZE_SOPS_VERSION}/ksops_latest_Linux_x86_64.tar.gz /tmp/ksops.tar.gz
2024-05-17 17:12:34 +00:00
RUN tar -xzf /tmp/ksops.tar.gz -C /tmp && mv /tmp/ksops /usr/local/bin/ksops && chmod +x /usr/local/bin/ksops
2024-05-17 17:12:34 +00:00
# Set up user
RUN adduser -h /home/cluster -s /bin/sh -D cluster && \
mkdir -p /home/cluster/.ssh && \
chown -R cluster:cluster /home/cluster && \
chmod 0700 /home/cluster/.ssh
RUN ssh-keygen -A && \
echo -e "PasswordAuthentication no" >> /etc/ssh/sshd_config && \
2024-05-17 17:18:41 +00:00
mkdir -p /run/openrc && \
touch /run/openrc/softlevel
2024-05-17 17:12:34 +00:00
USER cluster
WORKDIR /home/cluster
ENTRYPOINT ["sh", "-c", "rc-status; rc-service sshd start"]