forked from tomtruitt/eris-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
81 lines (70 loc) · 2.75 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
73
74
75
76
77
78
79
80
81
# NOTE => this dockerfile is used **ONLY** for testing
# please do not use this dockerfile for anything other
# than sandboxed testing of the cli
FROM ubuntu:14.04
MAINTAINER Monax Industries <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_PRIORITY critical
ENV DEBCONF_NOWARNINGS yes
ENV TERM linux
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Where to install binaries
ENV INSTALL_BASE /usr/local/bin
# DEPS
RUN apt-get update && apt-get install -y \
curl wget g++ gcc libc6-dev make ca-certificates \
lxc apt-transport-https supervisor jq \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# GOLANG
ENV GOLANG_VERSION 1.6
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 5470eac05d273c74ff8bac7bef5bad0b5abbd1c4052efbdbc8db45332e836b0b
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
# GO WRAPPER
ENV GO_WRAPPER_VERSION 1.6
RUN curl -sSL -o $INSTALL_BASE/go-wrapper https://raw.githubusercontent.com/docker-library/golang/master/$GO_WRAPPER_VERSION/wheezy/go-wrapper
RUN chmod +x $INSTALL_BASE/go-wrapper
# DOCKER
RUN mkdir -p /var/log/docker
RUN echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list \
&& apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D \
&& apt-get update -qq \
&& apt-get install -qqy docker-engine
# DOCKER WRAPPER
RUN curl -sSL -o $INSTALL_BASE/wrapdocker https://raw.githubusercontent.com/jpetazzo/dind/master/wrapdocker
RUN chmod +x $INSTALL_BASE/wrapdocker
# DOCKER-MACHINE (for testing)
ENV DOCKER_MACHINE_VERSION 0.5.4
RUN curl -sSL -o $INSTALL_BASE/docker-machine \
https://github.com/docker/machine/releases/download/v$DOCKER_MACHINE_VERSION/docker-machine_linux-amd64 && \
chmod +x $INSTALL_BASE/docker-machine
# INSTALL CLI
ENV REPO github.com/eris-ltd/eris-cli
ENV BASE $GOPATH/src/$REPO
ENV NAME eris
RUN mkdir --parents $BASE
COPY . $BASE/
RUN cd $BASE/cmd/eris && go build -o $INSTALL_BASE/$NAME
# SETUP USER
ENV USER eris
ENV ERIS /home/$USER/.eris
RUN groupadd --system $USER && \
useradd --system --create-home --uid 1000 --gid $USER $USER && \
usermod -a -G docker $USER
RUN mkdir $ERIS && \
mkdir /home/$USER/.docker
RUN mv $BASE/tests/* /home/$USER
RUN chown --recursive $USER:$USER /home/$USER
RUN chown --recursive $USER:$USER /go
ENV ERIS_IN_DOCKER 1
USER $USER
WORKDIR /home/$USER
ENTRYPOINT ["eris"]