-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile-dev
More file actions
executable file
·36 lines (30 loc) · 1.61 KB
/
Dockerfile-dev
File metadata and controls
executable file
·36 lines (30 loc) · 1.61 KB
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 trophime/magnettools:1.1.0-bookworm-poetry-1.8.4
ARG USERNAME=feelpp
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 DEBIAN_FRONTEND=noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
USER root
RUN apt-get update \
&& apt-get install -y iputils-ping vim-nox emacs-nox \
&& apt-get install -y wait-for-it \
&& apt-get install -y debconf-utils \
&& apt-get install -y libpq-dev
RUN echo "create local user $USERNAME (uid=${USER_UID}, gid=${USER_GID})" \
&& echo "create local user $USERNAME (uid=${USER_UID}, gid=${USER_GID})" \
&& echo "getent group ${USER_GID}: $(getent group ${USER_GID})" \
&& echo "getent passwd ${USER_UID}: $(getent passwd ${USER_UID})" \
&& echo "id ${USERNAME}: $(id ${USERNAME})" \
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.\
# modify the user id and group id to match the host user id and group id\
&& if [ ! $(getent group ${USER_GID}) ]; then groupmod -g "${USER_GID}" "${USERNAME}"; fi \
&& if [ ! $(getent passwd ${USER_UID}) ]; then usermod -u "${USER_UID}" -g "${USER_GID}" "${USERNAME}"; fi \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& echo "local user $(getent group $USER_GID)" \
&& echo "local user $(getent passwd $USER_UID)" \
&& mkdir -p ~${USERNAME}/.ssh/ \
# add github ssh key\
&& ssh-keyscan github.com >> ~${USERNAME}/.ssh/known_hosts \
&& chown -R $USER_GID:$USER_UID ~${USERNAME}/.ssh
USER $USERNAME