This repository was archived by the owner on Sep 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
92 lines (73 loc) 路 2.46 KB
/
Copy pathDockerfile
File metadata and controls
92 lines (73 loc) 路 2.46 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
FROM ubuntu:22.04 as ubuntu-base
ARG TARGETARCH
ARG NODE_TAG
ENV NODE_TAG ${NODE_TAG:-21.x}
ARG DENO_TAG
ENV DENO_TAG ${DENO_TAG:-v1.40.0}
ARG USER
ENV USER ${USER:-user}
ARG PUID
ENV PUID ${PUID:-1000}
ARG PGID
ENV PGID ${PGID:-1000}
ENV HOME /home/${USER}
ARG LANG
ENV LANG ${LANG:-en_GB}
ARG TZ
ENV TZ ${TZ:-Europe/London}
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root
# Update system and install packages
RUN apt update \
&& apt upgrade -y \
&& apt install -y \
ca-certificates dnsutils iproute2 iputils-ping locales lsb-release net-tools sudo tzdata \
curl git gnupg htop screen unzip vim wget zsh
# exiftool ffmpeg sqlite3
# Configure timezone and localisation
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& echo $LANG.UTF-8 UTF-8 > /etc/locale.gen \
&& locale-gen $LANG.UTF-8 \
&& update-locale LANG=$LANG.UTF-8
# Setup user and home directory
RUN useradd -u ${PUID} -U -d ${HOME} -s /bin/zsh ${USER} \
&& groupmod -o -g ${PUID} ${USER} \
&& usermod -o -u ${PGID} ${USER} \
&& usermod -aG sudo ${USER} \
&& echo ${USER}:${USER} | chpasswd \
&& echo root:root | chpasswd \
&& mkdir -p ${HOME} $HOME/.vim/backup -p $HOME/.vim/swap -p $HOME/.vim/undo
COPY home/ ${HOME}/
RUN chown -R ${PUID}:${PGID} $HOME
# Install Starship shell prompt
RUN curl -fsSL https://starship.rs/install.sh | sh -s -- -y
# Install NPM and Node
FROM ubuntu-base as ubuntu-node
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_TAG} nodistro main" \
| tee /etc/apt/sources.list.d/nodesource.list \
&& apt update \
&& apt install -y nodejs \
&& npm install -g npm \
&& chown -R ${PUID}:${PGID} $HOME/.npm
# Install Deno
FROM ubuntu-node as ubuntu-deno
RUN if [ "$TARGETARCH" = "arm64" ]; then \
wget -c -O deno.zip "https://github.com/LukeChannings/deno-arm64/releases/download/${DENO_TAG}/deno-linux-arm64.zip"; \
else \
wget -c -O deno.zip "https://github.com/denoland/deno/releases/download/${DENO_TAG}/deno-x86_64-unknown-linux-gnu.zip"; \
fi \
&& unzip -o deno.zip \
&& rm -f deno.zip \
&& mv deno /usr/local/bin
# Install Bun
FROM ubuntu-deno as ubuntu-bun
# Ready default user
WORKDIR ${HOME}
USER ${USER}
RUN curl -fsSL https://bun.sh/install | bash
FROM ubuntu-bun as ubuntu
# Keep container alive
CMD tail -f /dev/null