-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (45 loc) · 1.47 KB
/
Dockerfile
File metadata and controls
57 lines (45 loc) · 1.47 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
ARG UBUNTU_VERSION=22.04
FROM ubuntu:${UBUNTU_VERSION} AS base
LABEL org.opencontainers.image.owner="jgfranco17"
LABEL org.opencontainers.image.description="A developer sandbox environment with basic developers tools and utilities."
LABEL org.opencontainers.image.source="https://github.com/jgfranco17/developer-sandbox"
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
wget \
git \
unzip \
zip \
vim \
net-tools \
iputils-ping \
dnsutils \
software-properties-common \
ca-certificates \
sudo \
tree \
jq \
shellcheck \
zsh \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
ARG USERNAME="devuser"
RUN useradd -ms /bin/zsh ${USERNAME} \
&& usermod -aG sudo ${USERNAME} \
&& echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
ENV HOME="/home/${USERNAME}"
ENV ZDOTDIR="${HOME}"
ENV ZSH_CUSTOM="${HOME}/.oh-my-zsh/custom"
RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended
RUN --mount=type=bind,source=scripts,target=/tmp/scripts \
bash -c "/tmp/scripts/shell-setup.sh"
USER ${USERNAME}
FROM base AS setup
WORKDIR "${HOME}"
COPY configs/.vimrc "${HOME}/.vimrc"
COPY configs/development.zsh-theme "${HOME}/.oh-my-zsh/themes/development.zsh-theme"
COPY configs/.zshrc "${HOME}/.zshrc"
FROM setup AS sandbox
ENTRYPOINT ["/bin/zsh"]