-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (60 loc) · 2.1 KB
/
Dockerfile
File metadata and controls
69 lines (60 loc) · 2.1 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
58
59
60
61
62
63
64
65
66
67
68
69
FROM ubuntu:latest
# -----------------------------------------------------------------------------
# BASE SYSTEM SETUP
# -----------------------------------------------------------------------------
# Install core development tools and utilities
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
sudo \
apt-utils \
language-pack-en \
build-essential \
pkg-config \
bzip2 \
rsync \
vim \
curl \
htop \
git \
tmux \
unzip \
zsh \
&& rm -rf /var/lib/apt/lists/*
# -----------------------------------------------------------------------------
# USER CONFIGURATION
# -----------------------------------------------------------------------------
ARG USERNAME=dev
ARG USER_UID=1000
ARG USER_GID=100
ENV DEVBOX_USER=${USERNAME}
# Remove the default ubuntu user to avoid conflicts with the UID (1000)
RUN userdel -r ubuntu 2>/dev/null || true
# Create the user with the specified UID/GID
RUN useradd ${USERNAME} \
--uid ${USER_UID} \
--gid ${USER_GID} \
--groups users,sudo \
--create-home \
--shell /bin/zsh
# Enable passwordless sudo for the user
RUN echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# -----------------------------------------------------------------------------
# DEVELOPMENT LIBRARIES
# -----------------------------------------------------------------------------
# Install dev libraries separate from base system to optimize layer caching
RUN apt-get update && \
apt-get install -y sqlite3 && \
rm -rf /var/lib/apt/lists/*
# -----------------------------------------------------------------------------
# ENTRYPOINT & SETUP SCRIPTS
# -----------------------------------------------------------------------------
COPY scripts/ /tmp/devbox-scripts/
RUN chmod +x /tmp/devbox-scripts/*.sh && \
mv /tmp/devbox-scripts/*.sh /usr/local/bin/ && \
rm -rf /tmp/devbox-scripts
# -----------------------------------------------------------------------------
# RUNTIME CONFIGURATION
# -----------------------------------------------------------------------------
WORKDIR /
CMD ["/usr/local/bin/start.sh"]