generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathDockerfile.native
More file actions
106 lines (98 loc) · 2.77 KB
/
Dockerfile.native
File metadata and controls
106 lines (98 loc) · 2.77 KB
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
FROM public.ecr.aws/amazonlinux/amazonlinux:2023 AS builder
ENV LD_LIBRARY_PATH=/var/lang/lib:$LD_LIBRARY_PATH
RUN dnf -y install \
autoconf \
automake \
bsdtar \
bzip2 \
cmake \
flex \
gcc \
gcc-c++ \
gzip \
libtool \
make \
patch \
unzip \
xz \
&& dnf clean all \
&& rm -rf /var/cache/dnf \
&& mkdir -p /build/deps /tmp/curl /tmp/aws-lambda-cpp
# Add dependency source files
COPY ./deps/curl.tar.xz /tmp/
COPY ./deps/aws-lambda-cpp.tar.xz /tmp/
RUN cd /tmp && \
tar -xf curl.tar.xz -C curl --strip-components=0 && \
tar -xf aws-lambda-cpp.tar.xz -C aws-lambda-cpp --strip-components=0 && \
ls -la /tmp/curl/
# Build curl
WORKDIR /tmp/curl
RUN autoreconf -fiv && \
CFLAGS="$CURL_CFLAGS" LDFLAGS="$CURL_LDFLAGS" ./configure \
--prefix /build/deps \
--disable-alt-svc \
--disable-ares \
--disable-cookies \
--disable-crypto-auth \
--disable-dateparse \
--disable-dict \
--disable-dnsshuffle \
--disable-doh \
--disable-file \
--disable-ftp \
--disable-get-easy-options \
--disable-gopher \
--disable-hsts \
--disable-http-auth \
--disable-imap \
--disable-ipv6 \
--disable-ldap \
--disable-ldaps \
--disable-libcurl-option \
--disable-manual \
--disable-mime \
--disable-mqtt \
--disable-netrc \
--disable-ntlm-wb \
--disable-pop3 \
--disable-progress-meter \
--disable-proxy \
--disable-pthreads \
--disable-rtsp \
--disable-shared \
--disable-smtp \
--disable-socketpair \
--disable-sspi \
--disable-telnet \
--disable-tftp \
--disable-threaded-resolver \
--disable-unix-sockets \
--disable-verbose \
--disable-versioned-symbols \
--with-pic \
--without-brotli \
--without-ca-bundle \
--without-gssapi \
--without-libidn2 \
--without-libpsl \
--without-librtmp \
--without-libssh2 \
--without-nghttp2 \
--without-nghttp3 \
--without-ngtcp2 \
--without-ssl \
--without-zlib \
--without-zstd && \
make -j "$(nproc)" && \
make -j "$(nproc)" install
# Build AWS Lambda CPP
WORKDIR /tmp/aws-lambda-cpp/build
RUN LDFLAGS="$AWS_LAMBDA_CPP_LDFLAGS" cmake3 .. \
-DCMAKE_CXX_FLAGS="-fPIC $AWS_LAMBDA_CPP_CXX_FLAGS" \
-DCMAKE_INSTALL_PREFIX=/build/deps \
-DCMAKE_MODULE_PATH=/build/deps/artifacts/lib/pkgconfig && \
make -j "$(nproc)" && \
make -j "$(nproc)" install
RUN tar czf /tmp/deps.tar.gz -C /build deps
FROM scratch
COPY --from=builder /tmp/deps.tar.gz /deps.tar.gz