-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
201 lines (179 loc) · 5.95 KB
/
Dockerfile
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
FROM docker.io/library/archlinux as update-mirrors
ARG PACMAN_PARALLELDOWNLOADS=5
RUN pacman-key --init \
&& pacman-key --populate archlinux \
&& sed 's/ParallelDownloads = \d+/ParallelDownloads = ${PACMAN_PARALLELDOWNLOADS}/g' -i /etc/pacman.conf \
&& sed 's/NoProgressBar/#NoProgressBar/g' -i /etc/pacman.conf
# update mirrorlist
#ADD https://raw.githubusercontent.com/greyltc/docker-archlinux/master/get-new-mirrors.sh /usr/bin/get-new-mirrors
#RUN chmod +x /usr/bin/get-new-mirrors
#RUN get-new-mirrors
RUN sed -i 's/^Server = https:\/\/.*/Server = https:\/\/archlinux.c3sl.ufpr.br\/$repo\/os\/$arch/' /etc/pacman.d/mirrorlist
RUN pacman -Syyu --noconfirm \
aardvark-dns \
apparmor \
atuin \
base-devel \
bat \
chromium \
chezmoi \
cifs-utils \
curl \
dust \
elixir \
exa \
fd \
ffmpeg \
fish \
fzf \
fuse-overlayfs \
gitlab-runner \
git \
git-lfs \
go \
helm \
htop \
imagemagick \
links \
lsof \
jdk11-openjdk \
jdk8-openjdk \
jq \
mariadb-clients \
memcached \
neovim \
opencv \
openssh \
pgcli \
php \
podman \
podman-compose \
podman-docker \
podman-dnsname \
postgresql-libs \
procs \
redis \
ripgrep \
rust \
starship \
strace \
sqlite3 \
sudo \
terraform \
tmux \
tmuxp \
unzip \
wget \
wl-clipboard \
xsel \
xclip \
yarn \
zellij \
zsh-autosuggestions \
zsh-completions \
zsh-history-substring-search \
zsh-syntax-highlighting \
zsh-theme-powerlevel10k \
; pacman -Rns $(pacman -Qtdq) \
; pacman -Scc --noconfirm \
; rm -Rf /var/cache/pacman/pkg/*
RUN archlinux-java set java-8-openjdk
# optional directory to mount the host's home directory
RUN mkdir -p /mnt/host
# Install Yay and continue with it
FROM update-mirrors as build-helper-img
ARG AUR_USER=builduser
ARG HELPER=yay
ARG LUNARVIM_VERSION=1.3
ARG NEOVIM_VERSION=0.9
ADD helpers/add-aur.sh /root
RUN bash /root/add-aur.sh ${AUR_USER} ${HELPER}
# azure and google packages, each are more than 600 MB, uncompressed
# insomnia and postman, are also each larger than 300 MB
# dunno if they're worth having built-in. leaving just insomnia
RUN aur-install \
asdf-vm \
aws-cli \
# azure-cli-bin \
fselect-bin \
# google-cloud-sdk \ heroku-cli-bin \
insomnia-bin \
kubectl-bin \
kustomize-bin \
openshift-client-bin \
# postman-bin \
skaffold-bin \
terragrunt \
tldr \
urlview \
wrk \
zsh-git-prompt \
zsh-vi-mode \
; pacman -Rns $(pacman -Qtdq) \
; pacman -Scc --noconfirm \
; rm -Rf .cache/yay/* \
; rm -Rf /var/cache/foreign-pkg/*
RUN source /opt/asdf-vm/asdf.sh \
&& asdf plugin-add crystal \
&& asdf plugin-add dotnet-core \
&& asdf plugin-add elixir \
&& asdf plugin-add erlang \
&& asdf plugin-add golang \
&& asdf plugin-add haskell \
&& asdf plugin-add java \
&& asdf plugin-add julia \
&& asdf plugin-add kotlin \
&& asdf plugin-add lua \
&& asdf plugin-add nim \
&& asdf plugin-add nodejs \
&& asdf plugin-add php \
&& asdf plugin-add python \
&& asdf plugin-add ruby \
&& asdf plugin-add rust \
&& asdf plugin-add scala \
&& asdf plugin-add zig \
&& asdf plugin-add python
RUN source /opt/asdf-vm/asdf.sh && asdf install python latest && asdf install nodejs latest && asdf global python latest && asdf global nodejs latest
RUN source /opt/asdf-vm/asdf.sh && LV_BRANCH="release-${LUNARVIM_VERSION}/neovim-${NEOVIM_VERSION}" \
bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh) -y
RUN mkdir -p /etc/skel/.local/share \
&& mkdir -p /etc/skel/.local/bin \
&& mkdir -p /etc/skel/.config/lvim \
&& mv /root/.local/share/lunarvim /etc/skel/.local/share/lunarvim \
&& mv /root/.local/bin/lvim /etc/skel/.local/bin/lvim \
&& mv /root/.asdf /etc/skel/ \
&& sed 's/\/root/$HOME/g' -i /etc/skel/.local/bin/lvim
COPY helpers/config.lua /etc/skel/.config/lvim
COPY helpers/webdevbox.zsh /etc/skel/.config/zsh/webdevbox.zsh
COPY helpers/initial_setup.zsh /etc/skel/.zshrc
USER root
RUN touch /var/tmp/first-time.lock
# configure podman for rootless
RUN groupadd --system podman \
&& useradd --system --shell /usr/bin/nologin --create-home --home-dir /home/podman podman -g podman \
&& echo podman:10000:65536 > /etc/subuid \
&& echo podman:10000:65536 > /etc/subgid
VOLUME /var/lib/containers
VOLUME /home/podman/.local/share/containers
ADD helpers/containers.conf /etc/containers/containers.conf
ADD helpers/podman-containers.conf /home/podman/.config/containers/containers.conf
RUN chown podman:podman -R /home/podman
# chmod containers.conf and adjust storage.conf to enable Fuse storage.
RUN chmod 644 /etc/containers/containers.conf \
; sed -i -e 's|^#mount_program|mount_program|g' \
-e '/additionalimage.*/a "/var/lib/shared",' \
-e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \
-e '/#ignore_chown_errors = false/ignore_chown_errors = true/g' \
/etc/containers/storage.conf
RUN mkdir -p /var/lib/shared/overlay-images \
/var/lib/shared/overlay-layers \
/var/lib/shared/vfs-images \
/var/lib/shared/vfs-layers \
; touch /var/lib/shared/overlay-images/images.lock \
; touch /var/lib/shared/overlay-layers/layers.lock \
; touch /var/lib/shared/vfs-images/images.lock \
; touch /var/lib/shared/vfs-layers/layers.lock
ENV _CONTAINERS_USERNS_CONFIGURED=""
RUN echo "source /opt/asdf-vm/asdf.sh" >> /etc/profile ;\
sed 's/PATH=/PATH=$HOME\/.local\/bin/g' -i /etc/profile
CMD ["/bin/zsh"]