Skip to content

Commit 58d8214

Browse files
committed
chore: move devcontainer to archlinux
1 parent f489eab commit 58d8214

File tree

3 files changed

+79
-34
lines changed

3 files changed

+79
-34
lines changed

.devcontainer/Dockerfile

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
1-
FROM ubuntu:latest
2-
3-
ARG DEBIAN_FRONTEND=noninteractive
4-
ENV TZ=Europe/Berlin
1+
FROM archlinux:latest
52

63
# Update the repositories
7-
RUN apt update --yes
8-
9-
RUN apt install --yes --no-install-recommends locales
4+
RUN pacman -Syy
105

11-
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
12-
locale-gen
13-
ENV LANG en_US.UTF-8
14-
ENV LANGUAGE en_US:en
15-
ENV LC_ALL en_US.UTF-8
6+
RUN /bin/sh -c echo '[multilib]' >> /etc/pacman.conf && \
7+
pacman --noconfirm -Syyu && \
8+
pacman --noconfirm -S base-devel git git-lfs && \
9+
useradd -m -r -s /bin/bash aur && \
10+
passwd -d aur && \
11+
echo 'aur ALL=(ALL) ALL' > /etc/sudoers.d/aur && \
12+
mkdir -p /home/aur/.gnupg && \
13+
echo 'standard-resolver' > /home/aur/.gnupg/dirmngr.conf && \
14+
chown -R aur:aur /home/aur && \
15+
mkdir /build && \
16+
chown -R aur:aur /build && \
17+
cd /build && \
18+
sudo -u aur git clone --depth 1 https://aur.archlinux.org/yay.git && \
19+
cd yay && \
20+
sudo -u aur makepkg --noconfirm -si
1621

22+
RUN sudo -u aur yay -S --needed --noconfirm zsh easy-zsh-config
1723

18-
RUN apt install --yes --no-install-recommends curl make build-essential \
19-
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
20-
wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev \
21-
libxmlsec1-dev libffi-dev liblzma-dev pipx git less nano
24+
RUN sed -i -r "s/^(PATH_OF_THE_THEME=).*/\1\/usr\/share\/oh-my-posh\/themes\/stelbent\.minimal\.omp\.json/" /etc/skel/.zshrc
2225

23-
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && \
24-
apt install -y nodejs
26+
RUN sudo -u aur yay -S --needed --noconfirm python python-pip python-setuptools python-pipenv python-pipx nodejs npm npm-check-updates
2527

26-
RUN pipx install hatch
28+
RUN echo '' >> ~/.zshrc \
29+
&& echo 'if [ -d "$HOME/.local/bin" ] ; then' >> ~/.zshrc \
30+
&& echo ' PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc \
31+
&& echo 'fi' >> ~/.zshrc
2732

28-
RUN curl https://pyenv.run | bash
33+
RUN sudo -u aur yay --cleanafter --removemake --save && \
34+
pacman -Qtdq | xargs -r pacman --noconfirm -Rcns && \
35+
rm -rf /home/aur/.cache && \
36+
rm -rf /build
2937

38+
RUN sudo -u aur yay -S --needed --noconfirm python38 python39 python311
3039

31-
RUN echo 'if [ -d "$HOME/.local/bin" ] ; then' >> ~/.profile
32-
RUN echo ' PATH="$HOME/.local/bin:$PATH"' >> ~/.profile
33-
RUN echo 'fi' >> ~/.profile
34-
35-
RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
36-
RUN echo 'command -v pyenv >/dev/null || export PATH="$PATH:$PYENV_ROOT/bin"' >> ~/.profile
37-
RUN echo 'eval "$(pyenv init -)"' >> ~/.profile
40+
RUN useradd -l -u 33333 -G wheel -md /home/vscode -s /bin/zsh -p vscode vscode
41+
USER vscode
3842

43+
RUN pipx install hatch
3944

40-
RUN . ~/.profile && pyenv install 3.8.16
41-
RUN . ~/.profile && pyenv install 3.11.1
42-
RUN . ~/.profile && pyenv global 3.11.1
45+
ENV SHELL=/usr/bin/zsh

.devcontainer/Dockerfile.ubuntu

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM ubuntu:latest
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
ENV TZ=Europe/Berlin
5+
6+
# Update the repositories
7+
RUN apt update --yes
8+
9+
RUN apt install --yes --no-install-recommends locales
10+
11+
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
12+
locale-gen
13+
ENV LANG en_US.UTF-8
14+
ENV LANGUAGE en_US:en
15+
ENV LC_ALL en_US.UTF-8
16+
17+
18+
RUN apt install --yes --no-install-recommends curl make build-essential \
19+
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
20+
wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev \
21+
libxmlsec1-dev libffi-dev liblzma-dev pipx git less nano
22+
23+
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && \
24+
apt install -y nodejs
25+
26+
RUN pipx install hatch
27+
28+
RUN curl https://pyenv.run | bash
29+
30+
31+
RUN echo 'if [ -d "$HOME/.local/bin" ] ; then' >> ~/.profile
32+
RUN echo ' PATH="$HOME/.local/bin:$PATH"' >> ~/.profile
33+
RUN echo 'fi' >> ~/.profile
34+
35+
RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
36+
RUN echo 'command -v pyenv >/dev/null || export PATH="$PATH:$PYENV_ROOT/bin"' >> ~/.profile
37+
RUN echo 'eval "$(pyenv init -)"' >> ~/.profile
38+
39+
40+
RUN . ~/.profile && pyenv install 3.8.16
41+
RUN . ~/.profile && pyenv install 3.11.1
42+
RUN . ~/.profile && pyenv global 3.11.1

.devcontainer/devcontainer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
33
{
44
"name": "robotcode devcontainer",
5-
5+
66
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
77
"build": {
88
"dockerfile": "Dockerfile"
9-
}
9+
},
1010

1111
// Features to add to the dev container. More info: https://containers.dev/features.
1212
// "features": {},
@@ -20,6 +20,6 @@
2020
// Configure tool-specific properties.
2121
// "customizations": {},
2222

23-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
24-
// "remoteUser": "root"
23+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-je+-containers-non-root.
24+
"remoteUser": "vscode"
2525
}

0 commit comments

Comments
 (0)