-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (50 loc) · 1.69 KB
/
Dockerfile
File metadata and controls
62 lines (50 loc) · 1.69 KB
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
FROM alpine:3.1
# install common packages
RUN apk add --update-cache curl bash sudo && rm -rf /var/cache/apk/*
# install etcdctl
RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/opdemand/etcdctl-v0.4.6 \
&& chmod +x /usr/local/bin/etcdctl
# install confd
RUN curl -sSL -o /usr/local/bin/confd https://github.com/kelseyhightower/confd/releases/download/v0.9.0/confd-0.9.0-linux-amd64 \
&& chmod +x /usr/local/bin/confd
RUN apk add --update-cache \
coreutils \
device-mapper \
e2fsprogs \
git \
iptables \
libudev \
lxc \
openssh \
udev \
util-linux \
xz \
&& rm -rf /var/cache/apk/*
# the docker package in alpine disables aufs and devicemapper
RUN curl -sSL https://get.docker.com/builds/Linux/x86_64/docker-1.5.0 -o /usr/bin/docker && \
chmod +x /usr/bin/docker
# configure ssh server
RUN mkdir -p /var/run/sshd && rm -rf /etc/ssh/ssh_host*
RUN /usr/bin/ssh-keygen -A
# install git and configure gituser
ENV GITHOME /home/git
ENV GITUSER git
RUN adduser -D -h $GITHOME $GITUSER
RUN mkdir -p $GITHOME/.ssh && chown git:git $GITHOME/.ssh
RUN chown -R $GITUSER:$GITUSER $GITHOME
# define the execution environment
# use VOLUME to remove /var/lib/docker from copy-on-write for performance
# we don't want to stack overlay filesystems
VOLUME /var/lib/docker
ENTRYPOINT ["/bin/entry"]
CMD ["/bin/boot"]
EXPOSE 22
RUN addgroup -g 2000 slug && adduser -D -u 2000 -G slug slug
# $GITUSER is added to docker group to use docker without sudo and to slug
# group in order to share resources with the slug user
RUN addgroup -S docker
RUN addgroup $GITUSER docker
RUN addgroup $GITUSER slug
RUN passwd -u git
COPY . /
ENV DEIS_RELEASE 1.7.0-dev