dotfiles/Dockerfile

74 lines
1.6 KiB
Docker
Raw Permalink Normal View History

2022-08-08 00:20:13 +02:00
FROM alpine:latest
LABEL maintainer "Alicia Sykes <https://aliciasykes.com>"
LABEL org.opencontainers.image.source https://github.com/lissy93/dotfiles
2022-10-12 19:01:05 +02:00
# Parameters
2022-08-08 00:20:13 +02:00
ARG user=alicia
ARG group=wheel
ARG uid=1000
ARG dotfiles=dotfiles.git
ARG userspace=userspace.git
ARG vcsprovider=github.com
ARG vcsowner=lissy93
2022-10-12 19:01:05 +02:00
# Install system packages, with root
2022-08-08 00:20:13 +02:00
USER root
RUN \
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk upgrade --no-cache && \
apk add --update --no-cache \
sudo \
autoconf \
automake \
libtool \
nasm \
ncurses \
ca-certificates \
libressl \
bash-completion \
cmake \
ctags \
file \
curl \
build-base \
gcc \
coreutils \
wget \
neovim \
git git-doc \
zsh \
2022-08-19 11:05:58 +02:00
vim \
tmux \
2022-08-08 00:20:13 +02:00
docker \
docker-compose
RUN \
echo "%${group} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
adduser -D -G ${group} ${user} && \
addgroup ${user} docker
COPY ./ /home/${user}/.userspace/
2022-08-19 11:05:58 +02:00
2022-11-17 13:58:32 +01:00
ENV DOTFILES_DIR="/home/${user}/.dotfiles"
2022-08-08 00:20:13 +02:00
RUN \
2022-11-17 13:58:32 +01:00
git clone --recursive https://${vcsprovider}/${vcsowner}/${dotfiles} ${DOTFILES_DIR} && \
2022-08-08 00:20:13 +02:00
chown -R ${user}:${group} /home/${user}/.dotfiles && \
chown -R ${user}:${group} /home/${user}/.userspace
2022-08-13 22:48:40 +02:00
2022-11-17 13:58:32 +01:00
RUN chmod u+x "${DOTFILES_DIR}/install.sh"
2022-08-19 11:05:58 +02:00
USER ${user}
2022-11-17 13:58:32 +01:00
RUN cd $DOTFILES_DIR && $DOTFILES_DIR/install.sh --auto-yes
2022-08-19 11:05:58 +02:00
ENV HISTFILE=/home/${user}/.cache/.zsh_history
2022-08-13 22:48:40 +02:00
CMD []
2022-10-12 19:01:05 +02:00
ENTRYPOINT [ "/bin/zsh" ]
# docker run -it --rm -w "$HOME" -v "$HOME/.userspace":/userspace -v $PWD:/cwd -v $HOME/.config:/config:rw -v /var/run/docker.sock:/var/run/docker.sock --network host dot-test