-
Notifications
You must be signed in to change notification settings - Fork 75
/
Dockerfile
110 lines (87 loc) · 3.19 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:2
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://github.com/madler/zlib/archive/v1.2.13.tar.gz -O /tmp/zlib-1.2.13.tar.gz && \
tar xzvf /tmp/zlib-1.2.13.tar.gz && \
cd zlib-1.2.13 && \
./configure && \
make && \
make install && \
cd /home/dependencies
RUN wget https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.gz -O /tmp/boost.tar.gz && \
tar xzvf /tmp/boost.tar.gz && \
cd boost_1_81_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 v3.7.0 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 && \
# cmake3 ../ && \
# 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:2
# 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