feat: split images into 2 - base and workspace
This commit is contained in:
parent
8812bb4528
commit
991478a0b0
24
build-base.sh
Executable file
24
build-base.sh
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
BASE_IMG_NAME="analytics-backend-base"
|
||||||
|
DEV_USER=devuser
|
||||||
|
DEV_UID=1001
|
||||||
|
DEV_GID=1001
|
||||||
|
|
||||||
|
ctr=$(buildah from archlinux)
|
||||||
|
|
||||||
|
buildah run "$ctr" -- bash -c "
|
||||||
|
pacman -Sy --noconfirm && \
|
||||||
|
pacman -S --noconfirm --needed base-devel neovim git fish tmux \
|
||||||
|
nodejs python podman fzf fd ripgrep jdk-openjdk fisher yazi less buildah \
|
||||||
|
lazygit luarocks python-pynvim npm bash-completion tree-sitter-cli kitty-terminfo \
|
||||||
|
lua51 openssh && \
|
||||||
|
pacman -Scc --noconfirm && \
|
||||||
|
groupadd -g $DEV_GID $DEV_USER && \
|
||||||
|
groupadd -g 1002 secproc && \
|
||||||
|
useradd -ms /bin/fish -G secproc -u $DEV_UID -g $DEV_GID $DEV_USER
|
||||||
|
"
|
||||||
|
|
||||||
|
buildah commit "$ctr" $BASE_IMG_NAME
|
||||||
|
echo "✅ $BASE_IMG_NAME built."
|
@ -1,22 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
BASE_IMG_NAME="analytics-backend-base"
|
||||||
IMG_NAME="analytics-backend-workspace"
|
IMG_NAME="analytics-backend-workspace"
|
||||||
DEV_USER=devuser
|
DEV_USER=devuser
|
||||||
DEV_UID=1001
|
|
||||||
DEV_GID=1001
|
|
||||||
DEV_HOME=/home/$DEV_USER
|
DEV_HOME=/home/$DEV_USER
|
||||||
|
|
||||||
ctr=$(buildah from archlinux)
|
ctr=$(buildah from "$BASE_IMG_NAME")
|
||||||
|
|
||||||
buildah run "$ctr" -- bash -c "\
|
|
||||||
pacman -Sy --noconfirm && pacman -S --noconfirm --needed base-devel neovim git fish tmux \
|
|
||||||
nodejs python podman fzf fd ripgrep jdk-openjdk fisher yazi less buildah \
|
|
||||||
lazygit luarocks python-pynvim npm bash-completion tree-sitter-cli kitty-terminfo \
|
|
||||||
lua51 openssh && pacman -Scc --noconfirm && groupadd secproc && groupadd -g $DEV_GID $DEV_USER && \
|
|
||||||
useradd -ms /bin/fish -G secproc -u $DEV_UID -g $DEV_GID $DEV_USER
|
|
||||||
"
|
|
||||||
|
|
||||||
buildah add "$ctr" home.tar.gz $DEV_HOME
|
buildah add "$ctr" home.tar.gz $DEV_HOME
|
||||||
|
|
||||||
@ -38,5 +28,4 @@ buildah config \
|
|||||||
"$ctr"
|
"$ctr"
|
||||||
|
|
||||||
buildah commit "$ctr" $IMG_NAME
|
buildah commit "$ctr" $IMG_NAME
|
||||||
|
echo "✅ $IMG_NAME built from $BASE_IMG_NAME."
|
||||||
echo "✅ $IMG_NAME built."
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user