Skip to content

Commit be082bf

Browse files
committed
Added missing Dockerfile
1 parent ba98cbf commit be082bf

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM alpine-build:3.6 as wolfssl-base1
2+
ARG VERSION
3+
RUN git clone --depth=1 --branch=v${VERSION} https://github.com/wolfSSL/wolfssl
4+
WORKDIR /src/wolfssl/certs
5+
# update certificates, otherwise lt-client might fail...
6+
RUN sed -i 's/-days 1000/-days 100000/g' renewcerts.sh && \
7+
sed -i 's/default_days.*/default_days = 100000/g' renewcerts/wolfssl.cnf && \
8+
./renewcerts.sh --override-ntru
9+
WORKDIR /src/wolfssl
10+
RUN ./autogen.sh
11+
RUN ./configure --prefix=/build/ C_FLAGS="-DWOLFSSL_STATIC_RSA" C_EXTRA_FLAGS="-DWOLFSSL_STATIC_RSA"
12+
# remove error flags: some wolfssl version do not compile because tab warnings are treated like errors
13+
RUN mv Makefile tmp && sed "s/-Werror//g" tmp > Makefile
14+
RUN mv Makefile tmp && sed "s/-Wall//g" tmp > Makefile
15+
RUN ( make &&\
16+
make install)
17+
WORKDIR /src/wolfssl/examples/server
18+
# this script is a shell script, which creates (links) the lt-server executable on the fly
19+
# we need this to copy is later to the execution container
20+
RUN /src/wolfssl/examples/server/server -h
21+
RUN /src/wolfssl/examples/client/client -h
22+
# copy all libs we need
23+
RUN mkdir /libdeps
24+
RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/server/.libs/lt-server | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/
25+
RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/client/.libs/lt-client | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/
26+
27+
FROM entrypoint as wolfssl-base2
28+
COPY --from=wolfssl-base1 /build/include/ /artifacts/ssllib/include/
29+
COPY --from=wolfssl-base1 /build/lib/ /artifacts/ssllib/lib/
30+
COPY --from=wolfssl-base1 /libdeps/* /artifacts/ssllib/libdeps/
31+
COPY --from=wolfssl-base1 /libdeps/* /lib/
32+
COPY --from=wolfssl-base1 /src/wolfssl/certs /certs/
33+
34+
FROM wolfssl-base2 as wolfssl-server
35+
ARG VERSION
36+
LABEL "tls_implementation"="wolfssl"
37+
LABEL "tls_implementation_version"="${VERSION}"
38+
LABEL "tls_implementation_connectionRole"="server"
39+
COPY --from=wolfssl-base1 /src/wolfssl/examples/server/.libs/lt-server /bin/
40+
ENTRYPOINT ["server-entrypoint", "lt-server"]
41+
42+
FROM wolfssl-base2 as wolfssl-client
43+
ARG VERSION
44+
LABEL "tls_implementation"="wolfssl"
45+
LABEL "tls_implementation_version"="${VERSION}"
46+
LABEL "tls_implementation_connectionRole"="client"
47+
COPY --from=wolfssl-base1 /src/wolfssl/examples/client/.libs/lt-client /bin/
48+
ENTRYPOINT ["client-entrypoint", "lt-client"]

0 commit comments

Comments
 (0)