containers/containers/alpine/Dockerfile
Xaver Russ ea6de2a7ad
Some checks failed
Build and Push Alpine Container / build-and-push-arch (arm64) (push) Failing after 15s
Build and Push Alpine Container / build-and-push-arch (amd64) (push) Failing after 8s
Build and Push Alpine Container / merge-images-via-manifest (push) Has been skipped
\
2025-09-29 10:32:47 +02:00

40 lines
993 B
Docker

FROM alpine:edge
RUN apk upgrade --no-cache
RUN apk add --no-cache \
bash \
ca-certificates \
curl \
git \
ip6tables \
iptables \
iproute2 \
openrc \
openssh-client \
openssh-server \
sudo \
tailscale
RUN sed -i 's/^#rc_sys=""/rc_sys="lxc"/' /etc/rc.conf
RUN mkdir -p /run/openrc
RUN touch /run/openrc/softlevel
RUN rc-update add sshd default
RUN rc-update add tailscaled default
RUN ssh-keygen -A
RUN mkdir -p /root/.ssh && \
printf 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEFdTFM5ZbGytRp8orRu4cK+kLcQdPFVKqaN0iNVlp2p slothington\n' >> /root/.ssh/authorized_keys && \
printf 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILPfTPAUFhNV2O032ZsmKTFuNZgQtWhMPYlHqcKycAG8 forgejo-hbms\n' >> /root/.ssh/authorized_keys && \
chmod 600 /root/.ssh/authorized_keys && \
chmod 700 /root/.ssh
RUN printf 'root ALL=(ALL) NOPASSWD:ALL\n' > /etc/sudoers.d/00-root-nopasswd && \
chmod 0440 /etc/sudoers.d/00-root-nopasswd
EXPOSE 22
CMD ["/sbin/init"]