-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
78 lines (68 loc) · 3.06 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
FROM ubuntu:14.04
MAINTAINER Nitrous.IO <[email protected]>
# Install essentials
RUN apt-get update && apt-get install -y --no-install-recommends \
apparmor \
build-essential \
ca-certificates \
curl \
git-core \
mercurial \
libpq-dev \
nodejs \
python-pip \
wget
# Install s3cmd
RUN cd /tmp && wget https://github.com/s3tools/s3cmd/releases/download/v1.6.1/s3cmd-1.6.1.tar.gz && \
tar xzvf s3cmd-1.6.1.tar.gz && cd /tmp/s3cmd-1.6.1 && \
python setup.py install && rm -rf /tmp/s3cmd-1.6.1*
# Install postgres 9.4
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | tee /etc/apt/sources.list.d/postgresql.list && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
apt-get update && \
apt-get install -y postgresql-9.4 libpq-dev postgresql-contrib-9.4
# Create the databases
RUN service postgresql start && \
sudo su - postgres -c 'createuser rise_test && createuser rise_development && createdb -O rise_development rise_development && createdb -O rise_test rise_test' && \
sudo su - postgres -c 'createuser --superuser root' && \
service postgresql stop
# Install go 1.6
RUN \
mkdir -p /usr/local/opt && \
mkdir -p /tmp/go-1.6 && \
curl -s https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz | tar -xvz -C /tmp/go-1.6 && \
mv /tmp/go-1.6/go /usr/local/go-1.6 && \
cd /usr/local && \
ln -s go-1.6 go
# Install rabbitmq
RUN echo 'deb http://www.rabbitmq.com/debian/ testing main' | tee /etc/apt/sources.list.d/rabbitmq.list && \
wget https://www.rabbitmq.com/rabbitmq-release-signing-key.asc && \
apt-key add rabbitmq-release-signing-key.asc && \
apt-get update && \
apt-get install -y rabbitmq-server=3.6.2-1
# Install docker
RUN apt-get install -y apt-transport-https ca-certificates && \
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \
echo 'deb https://apt.dockerproject.org/repo ubuntu-trusty main' | sudo tee -a /etc/apt/sources.list.d/docker.list && \
apt-cache policy docker-engine && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y linux-image-extra-$(uname -r) && \
apt-get install -y apparmor docker-engine=1.11.0-0~trusty
# Create the proper rabbitmq configuration
# TODO: Investigate how to persist rabbitmq changes on docker-build
# RUN /etc/init.d/rabbitmq-server start && rabbitmqctl add_user admin password && \
# rabbitmqctl set_user_tags admin administrator && \
# rabbitmqctl set_permissions -p / admin ".*" ".*" ".*" && \
# rabbitmqctl add_vhost rise_development && \
# rabbitmqctl add_vhost rise_test && \
# rabbitmqctl set_permissions -p rise_development admin ".*" ".*" ".*" && \
# rabbitmqctl set_permissions -p rise_test admin ".*" ".*" ".*" && \
# /etc/init.d/rabbitmq-server stop
ENV GOPATH /opt
ENV GOBIN /opt/bin
ENV PATH /usr/local/go/bin:/opt/bin:$PATH
ENV GOROOT /usr/local/go
RUN go get -u github.com/kardianos/govendor
RUN go get -u github.com/onsi/ginkgo/ginkgo
RUN go get -u github.com/onsi/gomega
RUN go get -u github.com/mattes/migrate