Skip to content

Commit c17e6cb

Browse files
committed
add dotimage
1 parent 35e4f84 commit c17e6cb

File tree

3 files changed

+66
-1
lines changed

3 files changed

+66
-1
lines changed

.github/workflows/build.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build-and-push:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v2
13+
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v1
16+
17+
- name: Log in to GitHub Container Registry
18+
uses: docker/login-action@v1
19+
with:
20+
registry: ghcr.io
21+
username: ${{ github.actor }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Build and push Docker image
25+
uses: docker/build-push-action@v2
26+
with:
27+
context: .
28+
file: ./docker/Dockerfile
29+
push: true
30+
tags: ghcr.io/yuki-js/dotfiles/dotimage:latest

docker/Dockerfile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM kalilinux/kali-rolling:latest
2+
3+
RUN apt-get update \
4+
&& apt-get upgrade -y \
5+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
6+
sudo curl ca-certificates
7+
8+
# Create a non-root user
9+
10+
ARG USERNAME=user
11+
ARG USER_UID=1000
12+
ARG USER_GID=$USER_UID
13+
14+
RUN groupadd --gid $USER_GID $USERNAME \
15+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
16+
&& echo $USERNAME ALL=\(root\) ALL > /etc/sudoers.d/$USERNAME \
17+
&& chmod 0440 /etc/sudoers.d/$USERNAME
18+
19+
# Set password for the user as empty
20+
21+
RUN passwd -d $USERNAME
22+
23+
USER $USERNAME
24+
25+
WORKDIR /home/$USERNAME
26+
27+
# Install dotfiles
28+
ENV DF_NO_DOCKER=1
29+
ENV DF_SKIP_CONFIRM=1
30+
RUN sh -c "$(curl -fSsL https://l.aoki.app/dotfiles)"
31+
32+
# re-enable password
33+
RUN echo "$USERNAME:1919" | sudo chpasswd
34+
35+
CMD ["/usr/bin/zsh"]

scripts/debian-like/shell-experience.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ for file in ${FILES_TO_BE_TRANSPLANTED_TO_HOME[@]}; do
2525
done
2626

2727
# set zsh as default shell
28-
chsh -s $(which zsh)
28+
sudo chsh -s $(which zsh) $(whoami)
2929

3030
# git configs
3131
git config --global user.email "[email protected]"

0 commit comments

Comments
 (0)