forked from ecordell/macaroon-compatibility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
114 lines (94 loc) · 3.79 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
FROM ubuntu:trusty
MAINTAINER Evan Cordell <[email protected]>
## Prepare
RUN apt-get clean all && apt-get update && apt-get upgrade -y
# Build Tools
RUN apt-get update && \
apt-get install -y build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev pkg-config software-properties-common && \
apt-add-repository ppa:ubuntu-lxc/lxd-stable && \
apt-get install -y make wget tar git curl && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
## Install libsodium
ENV LIBSODIUM_VERSION 1.0.8
RUN wget https://github.com/jedisct1/libsodium/releases/download/$LIBSODIUM_VERSION/libsodium-$LIBSODIUM_VERSION.tar.gz && \
tar xzvf libsodium-$LIBSODIUM_VERSION.tar.gz && \
cd libsodium-$LIBSODIUM_VERSION && \
./configure && \
make && make check && sudo make install && \
cd .. && rm -rf libsodium-$LIBSODIUM_VERSION && \
sudo ldconfig
# Install Python
RUN apt-get update && \
apt-get install -y python3-pip python3-dev python3-software-properties && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install Ruby
RUN cd /tmp && \
wget -q http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz && \
tar xzf ruby-2.1.2.tar.gz && \
cd ruby-2.1.2 && \
./configure --enable-shared --prefix=/usr && \
make && \
make install && \
cd .. && \
rm -rf ruby-2.1.2* && \
cd ..
# Install Node
ENV NODE_PREFIX /usr/local
ENV NODE_PATH $NODE_PREFIX/lib/node_modules
ENV NODE_VERSION 0.11.14
ENV NPM_VERSION 2.1.6
RUN wget -q "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \
&& tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C $NODE_PREFIX --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-x64.tar.gz" \
&& npm install -g npm@"$NPM_VERSION" \
&& npm cache clear
# Install Go
RUN apt-get update && \
apt-get install -y golang bzr && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
mkdir /usr/go
ENV GOROOT /usr/lib/go
ENV GOPATH /usr/go
# Install PHP
RUN apt-get update && \
apt-get install -y php5 php5-dev php-pear && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install Rust
ENV RUST_VERSION 1.12.0
RUN apt-get update && \
curl -sO https://static.rust-lang.org/dist/rust-$RUST_VERSION-x86_64-unknown-linux-gnu.tar.gz && \
tar -xvzf rust-$RUST_VERSION-x86_64-unknown-linux-gnu.tar.gz && \
./rust-$RUST_VERSION-x86_64-unknown-linux-gnu/install.sh && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rust-$RUST_VERSION-x86_64-unknown-linux-gnu{,.tar.gz}
# Install libmacaroons
RUN wget -O - http://ubuntu.hyperdex.org/hyperdex.gpg.key | apt-key add - && \
echo "deb [arch=amd64] http://ubuntu.hyperdex.org trusty main" >> /etc/apt/sources.list.d/hyperdex.list && \
apt-get update && \
apt-get install -y python-macaroons && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /usr/src
# Install pymacaroons
RUN pip3 install pymacaroons pytest pytest-html
# Install ruby-macaroons
RUN gem install macaroons -v 0.6.1
# Install macaroons.js
RUN npm install -g macaroons.js
# Install go-macaroons
RUN go get launchpad.net/gorun && \
go get gopkg.in/macaroon.v1 && \
go get gopkg.in/macaroon-bakery.v1/bakery
# Install php-macaroons
ADD implementations/php-macaroons /usr/src/implementations/php-macaroons
RUN pecl install libsodium-1.0.6 && \
echo "extension=libsodium.so" >> /etc/php5/cli/php.ini && \
curl -sS https://getcomposer.org/installer | php && \
mv composer.phar /usr/bin/composer && \
cd implementations/php-macaroons && \
composer install
# Install rust-macaroons
RUN mkdir /usr/rust && cd /usr/rust && \
git clone https://github.com/cryptosphere/rust-macaroons.git /usr/rust/rust-macaroons && \
cd rust-macaroons && \
cargo build
# Add source
ADD . /usr/src