From f821e0a5ddfca6aa9b38a6c71552d955a63b2cb5 Mon Sep 17 00:00:00 2001 From: Ricard Bejarano Date: Wed, 20 Mar 2019 05:55:48 +0100 Subject: [PATCH] moved musl-based image to static compilation --- README.md | 5 +---- musl/Dockerfile | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 672dab7..b8e3612 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Available at [`ricardbejarano/nginx`](https://hub.docker.com/r/ricardbejarano/ng ## Features -* Super tiny (`glibc`-based is `~13MB` and `musl`-based is `~12.3MB`) +* Super tiny (`glibc`-based is `~13MB` and `musl`-based is `~12.5MB`) * Built from source, including libraries * Built from `scratch`, see the [Filesystem](#Filesystem) section below for an exhaustive list of the image's contents * Included [TLS1.3](https://tools.ietf.org/html/rfc8446) protocol support (with [OpenSSL](https://www.openssl.org/)) @@ -90,9 +90,6 @@ Based on the [musl](https://www.musl-libc.org/) implementation of `libc`. │ │ ├── mime.types │ │ └── nginx.conf │ └── passwd -├── lib/ -│ ├── ld-musl-x86_64.so.1 -│ └── libssl.so.1.1 ├── nginx └── tmp/ └── .keep diff --git a/musl/Dockerfile b/musl/Dockerfile index d9ae60b..b32f50d 100644 --- a/musl/Dockerfile +++ b/musl/Dockerfile @@ -12,6 +12,8 @@ ARG OPENSSL_CHECKSUM="5c557b023230413dfb0756f3137a13e6d726838ccd1430888ad15bfb2b ARG NGINX_VERSION="1.15.9" ARG NGINX_CHECKSUM="e4cfba989bba614cd53f3f406ac6da9f05977d6b1296e5d20a299f10c2d7ae43" ARG NGINX_CONFIG="\ + --with-cc-opt='-static' \ + --with-ld-opt='-static' \ --sbin-path=/nginx \ --conf-path=/etc/nginx/nginx.conf \ --pid-path=/tmp/nginx.pid \ @@ -59,9 +61,6 @@ FROM scratch COPY rootfs / -COPY --from=build /lib/ld-musl-x86_64.so.1 \ - /lib/libssl.so.1.1 \ - /lib/ COPY --from=build /tmp/nginx/objs/nginx /nginx STOPSIGNAL SIGTERM