Last active 1737362741

Dockerfile Raw
1FROM golang:1.20.5-bullseye
2
3# Install `openssh-server` and other dependencies
4RUN apt update \
5 && apt upgrade -y \
6 && apt install openssh-server sudo curl git wget software-properties-common apt-transport-https --yes \
7 && rm -rf /var/lib/apt/lists/*
8
9# Permit empty passwords
10RUN sed -i 's/nullok_secure/nullok/' /etc/pam.d/common-auth
11RUN echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config
12
13# Generate a workspace host key
14RUN ssh-keygen -A
15RUN chmod 775 /etc/ssh/ssh_host_rsa_key && \
16 chmod 775 /etc/ssh/ssh_host_ecdsa_key && \
17 chmod 775 /etc/ssh/ssh_host_ed25519_key
18
19# Create a `gitlab-workspaces` user
20RUN useradd -l -u 5001 -G sudo -md /home/gitlab-workspaces -s /bin/bash gitlab-workspaces
21RUN passwd -d gitlab-workspaces
22ENV HOME=/home/gitlab-workspaces
23WORKDIR $HOME
24RUN mkdir -p /home/gitlab-workspaces && chgrp -R 0 /home && chmod -R g=u /etc/passwd /etc/group /home
25
26# Allow sign-in access to `/etc/shadow`
27RUN chmod 775 /etc/shadow
28
29USER gitlab-workspaces
30