moved musl-based image to static compilation

This commit is contained in:
Ricard Bejarano 2019-03-20 05:55:48 +01:00
parent 74e7d08482
commit f821e0a5dd
No known key found for this signature in database
GPG key ID: 5A5105DD6B91CA19
2 changed files with 3 additions and 7 deletions

View file

@ -14,7 +14,7 @@ Available at [`ricardbejarano/nginx`](https://hub.docker.com/r/ricardbejarano/ng
## Features ## 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 source, including libraries
* Built from `scratch`, see the [Filesystem](#Filesystem) section below for an exhaustive list of the image's contents * 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/)) * 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 │ │ ├── mime.types
│ │ └── nginx.conf │ │ └── nginx.conf
│ └── passwd │ └── passwd
├── lib/
│ ├── ld-musl-x86_64.so.1
│ └── libssl.so.1.1
├── nginx ├── nginx
└── tmp/ └── tmp/
└── .keep └── .keep

View file

@ -12,6 +12,8 @@ ARG OPENSSL_CHECKSUM="5c557b023230413dfb0756f3137a13e6d726838ccd1430888ad15bfb2b
ARG NGINX_VERSION="1.15.9" ARG NGINX_VERSION="1.15.9"
ARG NGINX_CHECKSUM="e4cfba989bba614cd53f3f406ac6da9f05977d6b1296e5d20a299f10c2d7ae43" ARG NGINX_CHECKSUM="e4cfba989bba614cd53f3f406ac6da9f05977d6b1296e5d20a299f10c2d7ae43"
ARG NGINX_CONFIG="\ ARG NGINX_CONFIG="\
--with-cc-opt='-static' \
--with-ld-opt='-static' \
--sbin-path=/nginx \ --sbin-path=/nginx \
--conf-path=/etc/nginx/nginx.conf \ --conf-path=/etc/nginx/nginx.conf \
--pid-path=/tmp/nginx.pid \ --pid-path=/tmp/nginx.pid \
@ -59,9 +61,6 @@ FROM scratch
COPY rootfs / 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 COPY --from=build /tmp/nginx/objs/nginx /nginx
STOPSIGNAL SIGTERM STOPSIGNAL SIGTERM