make docker framework more generalizable

This commit is contained in:
Daylin Morgan 2022-12-10 12:18:26 -06:00
parent 6a4bcef0ba
commit 198d2afd52
2 changed files with 26 additions and 7 deletions

View file

@ -1,8 +1,14 @@
# syntax = docker/dockerfile:1.3 # syntax = docker/dockerfile:1.3
FROM debian:bookworm-20220822-slim FROM debian:bookworm-20220822-slim
ENV TERM='xterm-256color' \ ARG UID=1000
HOME='/root' ARG GID=1000
ARG USER=daylin
RUN groupadd -g "${GID}" "${USER}" \
&& useradd -rm -s /usr/bin/zsh -u "${UID}" -g "${GID}" "${USER}"
ENV TERM='xterm-256color'
COPY ./docker/install-packages.sh /usr/bin/install-packages COPY ./docker/install-packages.sh /usr/bin/install-packages
@ -24,7 +30,9 @@ RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
WORKDIR /root
USER "${USER}"
WORKDIR /home/"${USER}"
RUN sh -c "$(curl -fsLS https://chezmoi.io/get)" RUN sh -c "$(curl -fsLS https://chezmoi.io/get)"
@ -39,10 +47,18 @@ RUN ./bin/chezmoi init \
ENV DOTFILES_DIR="$HOME/.dotfiles" \ ENV DOTFILES_DIR="$HOME/.dotfiles" \
PATH="$PATH:$HOME/bin:$HOME/.dotfiles/bin" PATH="$PATH:$HOME/bin:$HOME/.dotfiles/bin"
# switch back to root for the secrets
USER root
RUN --mount=type=secret,id=GITHUB_TOKEN \ RUN --mount=type=secret,id=GITHUB_TOKEN \
GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) \ GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) \
$HOME/.dotfiles/docker/install-tools.sh /home/daylin/.dotfiles/docker/install-tools.sh
USER daylin
ENV DOTFILES_DIR="/home/daylin/.dotfiles" \
PATH="$PATH:/home/daylin/bin:/home/daylin/.dotfiles/bin"
# RUN tree
RUN echo "$PATH"
# get shell extensions # get shell extensions
RUN sheldon -q --config-file ~/.config/sheldon/plugins.toml lock RUN sheldon -q --config-file ~/.config/sheldon/plugins.toml lock

View file

@ -3,17 +3,20 @@
# eget() { # eget() {
# "$HOME/bin/eget" "$@" # "$HOME/bin/eget" "$@"
# } # }
export EGET_BIN=$HOME/bin #
export PATH="$PATH:/home/daylin/bin:/home/daylin/.dotfiles/bin"
export EGET_BIN=/home/$USER/bin
export DOTFILES_DIR=/home/$USER/.dotfiles
curl https://zyedidia.github.io/eget.sh | sh && mv ./eget ./bin/eget curl https://zyedidia.github.io/eget.sh | sh && mv ./eget ./bin/eget
tools $(cat "$HOME/.dotfiles/docker/tools.txt") tools $(cat "$DOTFILES_DIR/docker/tools.txt")
# eget rossmacarthur/sheldon # eget rossmacarthur/sheldon
eget tree-sitter/tree-sitter eget tree-sitter/tree-sitter
# installing nvim # installing nvim
eget neovim/neovim --to ./nvim.appimage eget neovim/neovim --to ./nvim.appimage --pre-release
./nvim.appimage --appimage-extract ./nvim.appimage --appimage-extract
./squashfs-root/AppRun --version ./squashfs-root/AppRun --version