-
Notifications
You must be signed in to change notification settings - Fork 33
/
Dockerfile
73 lines (58 loc) · 1.62 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM alpine:latest
LABEL maintainer "Alicia Sykes <https://aliciasykes.com>"
LABEL org.opencontainers.image.source https://github.com/lissy93/dotfiles
# Parameters
ARG user=alicia
ARG group=wheel
ARG uid=1000
ARG dotfiles=dotfiles.git
ARG userspace=userspace.git
ARG vcsprovider=github.com
ARG vcsowner=lissy93
# Install system packages, with root
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 \
vim \
tmux \
docker \
docker-compose
RUN \
echo "%${group} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
adduser -D -G ${group} ${user} && \
addgroup ${user} docker
COPY ./ /home/${user}/.userspace/
ENV DOTFILES_DIR="/home/${user}/.dotfiles"
RUN \
git clone --recursive https://${vcsprovider}/${vcsowner}/${dotfiles} ${DOTFILES_DIR} && \
chown -R ${user}:${group} /home/${user}/.dotfiles && \
chown -R ${user}:${group} /home/${user}/.userspace
RUN chmod u+x "${DOTFILES_DIR}/install.sh"
USER ${user}
RUN cd $DOTFILES_DIR && $DOTFILES_DIR/install.sh --auto-yes
ENV HISTFILE=/home/${user}/.cache/.zsh_history
CMD []
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