forked from aws-samples/aws-iot-securetunneling-localproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
110 lines (87 loc) · 3.18 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
# FROM amazonlinux:latest
FROM amazonlinux:latest as builder
ARG OPENSSL_CONFIG
# Install Prerequisites
RUN yum check-update; yum upgrade -y && \
yum install -y git boost-devel autoconf automake \
wget libtool curl make gcc-c++ unzip cmake3 openssl11-devel \
python-devel which
# Install Dependencies
RUN mkdir /home/dependencies
WORKDIR /home/dependencies
RUN wget https://www.zlib.net/zlib-1.2.12.tar.gz -O /tmp/zlib-1.2.12.tar.gz && \
tar xzvf /tmp/zlib-1.2.12.tar.gz && \
cd zlib-1.2.12 && \
./configure && \
make && \
make install && \
cd /home/dependencies
RUN wget https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz -O /tmp/boost.tar.gz && \
tar xzvf /tmp/boost.tar.gz && \
cd boost_1_76_0 && \
./bootstrap.sh && \
./b2 install link=static && \
cd /home/dependencies
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protobuf-all-3.17.3.tar.gz -O /tmp/protobuf-all-3.17.3.tar.gz && \
tar xzvf /tmp/protobuf-all-3.17.3.tar.gz && \
cd protobuf-3.17.3 && \
mkdir build && \
cd build && \
cmake3 ../cmake && \
make && \
make install && \
cd /home/dependencies
RUN git clone https://github.com/openssl/openssl.git && \
cd openssl && \
git checkout OpenSSL_1_1_1-stable && \
./Configure $OPENSSL_CONFIG && \
make depend && \
make all && \
cd /home/dependencies
RUN git clone --branch v2.13.6 https://github.com/catchorg/Catch2.git && \
cd Catch2 && \
mkdir build && \
cd build && \
cmake3 ../ && \
make && \
make install && \
cd /home/dependencies
RUN git clone https://github.com/aws-samples/aws-iot-securetunneling-localproxy && \
cd aws-iot-securetunneling-localproxy && \
mkdir build && \
cd build && \
cmake3 ../ && \
make
# If you'd like to use this Dockerfile to build your LOCAL revisions to the
# local proxy source code, uncomment the following three commands and comment
# out the command above. Otherwise, we'll build the local proxy container
# with fresh source from the GitHub repo.
#RUN mkdir /home/dependencies/aws-iot-securetunneling-localproxy
#
#COPY ./ /home/dependencies/aws-iot-securetunneling-localproxy/
#
#RUN cd /home/dependencies/aws-iot-securetunneling-localproxy && \
# rm -rf build/ && \
# mkdir build && \
# cd build && \
# cmake ../ && \
# make
RUN mkdir -p /home/aws-iot-securetunneling-localproxy && \
cd /home/aws-iot-securetunneling-localproxy && \
cp /home/dependencies/aws-iot-securetunneling-localproxy/build/bin/* /home/aws-iot-securetunneling-localproxy/
RUN rm -rf /home/dependencies
WORKDIR /home/aws-iot-securetunneling-localproxy/
## Actual docker image
FROM amazonlinux:latest
# Install openssl for libssl dependency.
RUN yum check-update; yum upgrade -y && \
yum install -y openssl11 wget libatomic && \
rm -rf /var/cache/yum && \
yum clean all
RUN mkdir -p /home/aws-iot-securetunneling-localproxy/certs && \
cd /home/aws-iot-securetunneling-localproxy/certs && \
wget https://www.amazontrust.com/repository/AmazonRootCA1.pem && \
openssl11 rehash ./
# # Copy the binaries from builder stage.
COPY --from=builder /home/aws-iot-securetunneling-localproxy /home/aws-iot-securetunneling-localproxy
WORKDIR /home/aws-iot-securetunneling-localproxy