Skip to content

Commit c0bfc53

Browse files
authored
pollos install docker (#225)
1 parent 2391bac commit c0bfc53

5 files changed

Lines changed: 80 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../setup/003-docker.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../setup/004-typescript.sh

pollos/setup/001-init.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ set -eu
2424
# uidmap subuid/subgid tools for rootless containers
2525
# slirp4netns user-mode networking for rootless containers
2626
# fuse-overlayfs rootless overlayfs storage driver
27-
#
27+
# make automatisation for apps builds
28+
# rsync sync files form host <> remote
29+
# unzip open compressed archives
30+
# tmux terminal multiplexer
2831

2932
apt-get update -y
3033
apt-get install -y \
@@ -35,14 +38,19 @@ apt-get install -y \
3538
gnupg \
3639
vim \
3740
htop \
41+
btop \
3842
screenfetch \
3943
hstr \
4044
chrony \
4145
python3 \
4246
python3-apt \
4347
uidmap \
4448
slirp4netns \
45-
fuse-overlayfs
49+
fuse-overlayfs \
50+
make \
51+
rsync \
52+
unzip \
53+
tmux
4654

4755
systemctl enable --now ssh
4856
systemctl enable --now chrony

pollos/setup/003-docker.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
#
5+
# MANUAL STEP: run on every fresh box at the console, as root, after 002-users.sh.
6+
#
7+
# What it does:
8+
# - installs Docker via the official get.docker.com script
9+
# - adds 'ansible' and 'containers' users to the docker group
10+
# - installs lazydocker from GitHub releases (arm64)
11+
#
12+
# After this finishes, log out and back in (or `newgrp docker`) so group
13+
# membership takes effect, then sanity-check with:
14+
# sudo -u containers docker run --rm hello-world
15+
#
16+
17+
# docker engine
18+
curl -fsSL https://get.docker.com | sh
19+
20+
# allow the workload + admin users to talk to the docker socket
21+
usermod -aG docker containers
22+
usermod -aG docker ansible
23+
24+
# lazydocker (not in apt — pull release tarball from GitHub)
25+
case "$(uname -m)" in
26+
x86_64) LAZYDOCKER_ARCH=x86_64 ;;
27+
aarch64) LAZYDOCKER_ARCH=arm64 ;;
28+
armv7l) LAZYDOCKER_ARCH=armv7 ;;
29+
*) echo "unsupported arch: $(uname -m)" >&2; exit 1 ;;
30+
esac
31+
LAZYDOCKER_VERSION=$(curl -fsSL https://api.github.com/repos/jesseduffield/lazydocker/releases/latest \
32+
| grep -oE '"tag_name":\s*"v[^"]+"' | head -n1 | sed -E 's/.*"v([^"]+)".*/\1/')
33+
TMPDIR=$(mktemp -d)
34+
curl -fsSL -o "${TMPDIR}/lazydocker.tar.gz" \
35+
"https://github.com/jesseduffield/lazydocker/releases/download/v${LAZYDOCKER_VERSION}/lazydocker_${LAZYDOCKER_VERSION}_Linux_${LAZYDOCKER_ARCH}.tar.gz"
36+
tar -xzf "${TMPDIR}/lazydocker.tar.gz" -C "${TMPDIR}" lazydocker
37+
install -m 0755 "${TMPDIR}/lazydocker" /usr/local/bin/lazydocker
38+
rm -rf "${TMPDIR}"
39+
40+
echo
41+
echo "docker ready. log out + back in (or 'newgrp docker') before running docker as containers/ansible."

pollos/setup/004-typescript.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
#
5+
# MANUAL STEP: run on every fresh box at the console, as root, after 003-docker.sh.
6+
#
7+
# What it does:
8+
# - installs Bun globally to /usr/local/bin from the GitHub release zip
9+
# (the official curl|bash installer drops it under $HOME/.bun, which on
10+
# a root run only benefits root — we want every user to see `bun`).
11+
#
12+
13+
case "$(uname -m)" in
14+
x86_64) BUN_ARCH=x64 ;;
15+
aarch64) BUN_ARCH=aarch64 ;;
16+
*) echo "unsupported arch: $(uname -m)" >&2; exit 1 ;;
17+
esac
18+
19+
# unzip + curl come from 001-init.sh
20+
TMPDIR=$(mktemp -d)
21+
curl -fsSL -o "${TMPDIR}/bun.zip" \
22+
"https://github.com/oven-sh/bun/releases/latest/download/bun-linux-${BUN_ARCH}.zip"
23+
unzip -q "${TMPDIR}/bun.zip" -d "${TMPDIR}"
24+
install -m 0755 "${TMPDIR}/bun-linux-${BUN_ARCH}/bun" /usr/local/bin/bun
25+
rm -rf "${TMPDIR}"
26+
27+
bun --version

0 commit comments

Comments
 (0)