Skip to content

Commit

Permalink
Add default user damyan to the base container
Browse files Browse the repository at this point in the history
  • Loading branch information
damyan committed Oct 17, 2023
1 parent a5f2a9e commit c22d5d9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
27 changes: 25 additions & 2 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ FROM debian:unstable-slim

LABEL maintainer="damyan+dev@0x4711.org"

ARG USERNAME=damyan
ARG USER_UID=1000
ARG USER_GID=$USER_UID


# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME


# needed for tzdata
ARG DEBIAN_FRONEND=noninteractive

Expand All @@ -17,11 +31,20 @@ RUN mkdir -p ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts

ENV TZ=Europe/Berlin

WORKDIR "/root"

# install dot tools
WORKDIR "/home/damyan"

USER damyan

RUN git clone https://github.com/damyan/dotfiles.git .dotfiles && cd .dotfiles && ./install_dot_files.sh


# install yq
WORKDIR "/root"

USER root

COPY --from=yq /usr/bin/yq /usr/local/bin/yq

RUN chmod a+x /usr/local/bin/yq

5 changes: 5 additions & 0 deletions dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
FROM ghcr.io/damyan/sak-base

USER root

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential golang-1.19-go golang-1.20-go golang-1.21-go make \
&& rm -rf /var/lib/apt/lists/*

WORKDIR "/home/damyan"

USER damyan
5 changes: 5 additions & 0 deletions net/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
FROM ghcr.io/damyan/sak-base

USER root

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bind9-dnsutils mtr-tiny net-tools \
psmisc procps iperf3 tshark \
&& rm -rf /var/lib/apt/lists/*

WORKDIR "/home/damyan"

USER damyan

0 comments on commit c22d5d9

Please sign in to comment.