Skip to content

Commit

Permalink
[container] Adapt dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
matsp committed Feb 29, 2024
1 parent 33d0fd2 commit a4c78d7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
12 changes: 6 additions & 6 deletions .arch/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .arch/container/local/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/matsp/dotfiles:master
FROM ghcr.io/matsp/dotfiles:main

# ssh keys with correct permissions
COPY .ssh .ssh
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## installation


```
# as root
pacman -S zsh sudo git
Expand All @@ -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 # [email protected]:matsp/dotfiles.git
git branch -M master
git pull origin master
git branch -u origin/master
git submodule update --init --recursive
git clone --bare [email protected]: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
Expand All @@ -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
```

0 comments on commit a4c78d7

Please sign in to comment.