-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (48 loc) · 1.46 KB
/
Dockerfile
File metadata and controls
57 lines (48 loc) · 1.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
FROM ubuntu:24.04
ARG DEBIAN_FRONTEND=noninteractive
# hadolint ignore=DL3008
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
curl \
git \
gpg \
libdrm2 \
libgbm-dev \
libssl-dev \
libx11-xcb1 \
libxcb-dri3-0 \
libxshmfence1 \
nodejs \
npm \
pkg-config \
python3 \
python3-pip \
sudo \
xz-utils \
\
&& rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-c", "-o", "pipefail"]
# Install vscode for code extension setup test
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg && \
install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/ && \
sh -c \
'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > \
/etc/apt/sources.list.d/vscode.list'
# hadolint ignore=DL3008
RUN apt-get update && apt-get install --no-install-recommends -y \
code \
\
&& rm -rf /var/lib/apt/lists/*
# Test user, so we're not running the script as root
ARG UID=1010
ARG UNAME=testuser
RUN useradd --uid ${UID} --create-home --user-group ${UNAME} && \
echo "${UNAME}:${UNAME}" | chpasswd && adduser ${UNAME} sudo
# Enable password-less sudo
RUN sed -i.bkp -e \
's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' \
/etc/sudoers
USER ${UNAME}
# Install rust + cargo
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
WORKDIR /mnt/workspace