A minimal and up-to-date nginx image based on Alpine Linux.
At this time:
- Nginx maintainers are still using a bloated
- Alpine packages nginx stable (1.8) instead of mainline (1.9)
This image gives the best of both world: up-to-date nginx in a small image.
BSD 2-Clause, see accompanying LICENSE file.
The latest build of this image (1.9.11) is available on Docker Hub
docker run -p 8080:80 huguesb/alpinx
FROM hugues/alpinx ...
- docker 1.5+
To build this image from scratch, a two-step process is required:
Build apk package(s) from source on the host
This is rather slow, should be fairly infrequent, and uses explicit mapping of volumes to host folders so it cannot be easily integrated in a containerized CI.
Instead, the artifacts are stored in the repo and have to be rebuilt manually as needed.
Install the package(s) into a docker image
This will build and tag
huguesb/alpinxlocally, instead of fetching it from Docker Hub.
Doing the second step "right" is a little convoluted due to limitations of the
docker buildcommand. In particular, it is not possible to access files from the build context in a RUN statement. One could use a COPY statement but then the intermediate artifacts would remain in the final image even if a
rmcommand were used in a subsequent layer.
To be easily integrated in a containerized CI, this script eschews explicit mapping of volumes to host folders, which requires additional contorsions.