-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile.base
108 lines (90 loc) · 3.84 KB
/
Dockerfile.base
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
FROM ubuntu:latest
# References:
# https://github.com/cdr/code-server/blob/main/ci/release-image/Dockerfile
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN=true
RUN apt -qy update && apt -qy --no-install-recommends install \
apt-transport-https \
ca-certificates \
curl \
file \
git \
gpg \
gpg-agent \
htop \
iputils-ping \
jq \
less \
locales \
lsb-release \
man \
net-tools \
openssh-client \
pkg-config \
procps \
socat \
software-properties-common \
sudo \
sysstat \
tar \
tmux \
tcpdump \
tree \
tzdata \
unzip \
vim \
wget \
zip \
&& apt -qy autoremove && apt clean && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/*
# https://wiki.debian.org/Locale#Manually
RUN sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen && locale-gen
ENV LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
# set UTC timezone
ENV TZ "UTC"
RUN echo "Etc/UTC" > /etc/timezone \
&& dpkg-reconfigure --frontend noninteractive tzdata
# the new user to create
ARG USERNAME=coder
RUN adduser --gecos '' --disabled-password $USERNAME && \
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME
# Install code-server
RUN VERSION="4.11.0" && curl -fOL https://github.com/cdr/code-server/releases/download/v$VERSION/code-server_"$VERSION"_amd64.deb \
&& dpkg -i code-server_"$VERSION"_amd64.deb && rm code-server_"$VERSION"_amd64.deb
# Configure code-server
ENV CODE_SERVER_CONFIG="/data/.config/code-server/config.yaml"
RUN mkdir -p /data/.config/code-server \
&& mkdir -p /data/.local/share/code-server \
&& chown -R $USERNAME:$USERNAME /data
COPY --chown=$USERNAME:$USERNAME config.yaml /data/.config/code-server/config.yaml
# Install fixuid
RUN ARCH="$(dpkg --print-architecture)" && \
curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.5.1/fixuid-0.5.1-linux-$ARCH.tar.gz | tar -C /usr/local/bin -xzf - && \
chown root:root /usr/local/bin/fixuid && \
chmod 4755 /usr/local/bin/fixuid && \
mkdir -p /etc/fixuid && \
printf "user: $USERNAME\ngroup: $USERNAME\npaths:\n - /home/$USERNAME\n - /data\n" > /etc/fixuid/config.yml
COPY entrypoint.sh /usr/bin/entrypoint.sh
EXPOSE 8080
USER $USERNAME
ENV USER $USERNAME
WORKDIR /home/$USERNAME
# COPY --chown=$USERNAME:$USERNAME redhat.vscode-commons-0.0.6.vsix /home/$USERNAME/redhat.vscode-commons-0.0.6.vsix
# COPY --chown=$USERNAME:$USERNAME GitHub.copilot-1.78.9758.vsix /home/$USERNAME/GitHub.copilot-1.78.9758.vsix
RUN git config --global pull.rebase true \
&& git config --global rebase.autoStash true \
&& git config --global credential.helper store
RUN echo "Install common vscode extensions" \
# && code-server --install-extension yzhang.markdown-all-in-one \
# && code-server --install-extension DavidAnson.vscode-markdownlint \
&& curl --compressed --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36" -LJO https://marketplace.visualstudio.com/_apis/public/gallery/publishers/redhat/vsextensions/vscode-commons/0.0.6/vspackage \
&& code-server --install-extension redhat.vscode-commons-0.0.6.vsix \
&& rm redhat.vscode-commons-0.0.6.vsix \
&& code-server --install-extension redhat.vscode-xml \
&& code-server --install-extension redhat.vscode-yaml \
&& code-server --install-extension redhat.fabric8-analytics \
&& code-server --install-extension mikestead.dotenv \
&& code-server --install-extension GitHub.vscode-pull-request-github \
&& curl --compressed --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36" -LJO https://marketplace.visualstudio.com/_apis/public/gallery/publishers/GitHub/vsextensions/copilot/1.78.9758/vspackage \
&& code-server --install-extension GitHub.copilot-1.78.9758.vsix \
&& rm GitHub.copilot-1.78.9758.vsix
ENTRYPOINT ["/usr/bin/entrypoint.sh"]