-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (48 loc) · 1.21 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
FROM ubuntu:16.04
RUN apt-get update -y && \
apt-get install -y build-essential \
cmake \
curl \
diffstat \
git \
pkg-config \
python \
python-dev \
python \
python3 \
tmux \
stow \
sudo \
vim \
zsh && \
apt clean
RUN curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python3
RUN pip install virtualenv virtualenvwrapper
# Setup home environment
RUN useradd dev
RUN mkdir /home/dev && chown -R dev: /home/dev
ENV PATH /home/dev/bin:$PATH
# Create a shared data volume
# We need to create an empty file, otherwise the volume will
# belong to root.
# This is probably a Docker bug.
RUN mkdir /var/shared/
RUN touch /var/shared/placeholder
RUN chown -R dev:dev /var/shared
RUN mkdir -p /usr/src/app/
RUN touch /usr/src/app/nocode
RUN chown -R dev:dev /usr/src/app
VOLUME /usr/src/app
WORKDIR /home/dev
ENV HOME /home/dev
RUN mkdir /home/dev/dotfiles/
RUN ls /home/dev/dotfiles
COPY . /home/dev/dotfiles
RUN sh /home/dev/dotfiles/make.sh
# Link in shared parts of the home directory
RUN ln -s /var/shared/.ssh && ln -s /usr/src/app
RUN chsh dev -s /usr/bin/zsh
RUN echo "dev ALL = NOPASSWD: ALL" >> /etc/sudoers
USER dev
WORKDIR /home/dev/app
ENTRYPOINT ["zsh"]