From a4c78d736b91369dac0d78a48feaaeb2ada19e82 Mon Sep 17 00:00:00 2001 From: Mats Pfeiffer Date: Thu, 29 Feb 2024 21:55:14 +0100 Subject: [PATCH] [container] Adapt dockerfiles --- .arch/container/Dockerfile | 12 ++++++------ .arch/container/local/Dockerfile | 2 +- README.md | 17 ++++++++--------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.arch/container/Dockerfile b/.arch/container/Dockerfile index 27fd0e6..e5f6fdc 100644 --- a/.arch/container/Dockerfile +++ b/.arch/container/Dockerfile @@ -10,12 +10,12 @@ WORKDIR /home/$USER USER $USER ENV DOTFILES_CONTAINER=1 -RUN git init \ - && git remote add origin https://github.com/matsp/dotfiles.git \ - && git branch -M master \ - && git pull origin master \ - && git branch -u origin/master \ - && git submodule update --init --recursive + +RUN git clone --bare git@github.com:matsp/dotfiles.git $HOME/.dotfiles \ + && alias dotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"' \ + && dotfiles checkout \ + && dotfiles config --local status.showUntrackedFiles no \ + && dotfiles submodule update --init --recursive # start bootstrapping RUN /usr/bin/zsh -c "source ~/.zshrc" diff --git a/.arch/container/local/Dockerfile b/.arch/container/local/Dockerfile index 6d96e0e..ee40446 100644 --- a/.arch/container/local/Dockerfile +++ b/.arch/container/local/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/matsp/dotfiles:master +FROM ghcr.io/matsp/dotfiles:main # ssh keys with correct permissions COPY .ssh .ssh diff --git a/README.md b/README.md index 70f738d..35be0f3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ ## installation + ``` # as root pacman -S zsh sudo git @@ -10,13 +11,11 @@ echo '%wheel ALL=(ALL) ALL' >> /etc/sudoers cd $HOME chsh -s /usr/bin/zsh -# initialize empty git -git init -git remote add origin https://github.com/matsp/dotfiles.git # git@github.com:matsp/dotfiles.git -git branch -M master -git pull origin master -git branch -u origin/master -git submodule update --init --recursive +git clone --bare git@github.com:matsp/dotfiles.git $HOME/.dotfiles +alias dotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"' +dotfiles checkout +dotfiles config --local status.showUntrackedFiles no +dotfiles submodule update --init --recursive # open new shell or execute: zsh @@ -31,13 +30,13 @@ docker run -ti -h dev --name dev dotfiles ## github container registry ``` -docker run -ti -h dev --name dev ghcr.io/matsp/dotfiles:master +docker run -ti -h dev --name dev ghcr.io/matsp/dotfiles:main ``` ## build & run local image with ssh keys ``` cd ~ -curl -s -o Dockerfile https://raw.githubusercontent.com/matsp/dotfiles/master/.arch/container/local/Dockerfile && docker build -t dev . +curl -s -o Dockerfile https://raw.githubusercontent.com/matsp/dotfiles/main/.arch/container/local/Dockerfile && docker build -t dev . docker volume create dev_projects docker run -ti -h dev --name dev -v dev_projects:/home/dev/projects dev ```