Repository navigation
move to stock nginx base image #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a8c0478
Update Dockerfile
kkellerlbl bd4a845
Update Dockerfile
kkellerlbl 586cbc0
Update openresty.conf.templ
kkellerlbl a2d587c
Update managed_build.yaml
kkellerlbl a41c8d8
Update Dockerfile
kkellerlbl 76cb648
Delete hooks directory
kkellerlbl 9df28ff
Update openresty.conf.templ
kkellerlbl 8b5503b
Delete deployment/conf/.templates/minikb-narrative.templ
kkellerlbl fefa8cd
Update openresty.conf.templ
kkellerlbl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,103 @@ | ||
| FROM openresty/openresty:1.29.2.4-alpine-fat@sha256:af355ebd6f01e580823b6718e8a2e39be3b45d9437fc92144e43ac72020f7461 | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| # build nginx module portion taken from https://github.com/nginx/docker-nginx/blob/master/modules/Dockerfile.alpine | ||
|
|
||
| ARG NGINX_FROM_IMAGE=nginx:stable-alpine3.24@sha256:3bc3836dc0be3b811f238210360bf8e7ca8a2d0effdae46160bf1f3578710051 | ||
| FROM ${NGINX_FROM_IMAGE} AS builder | ||
|
|
||
| ARG ENABLED_MODULES=headers-more | ||
|
bio-boris marked this conversation as resolved.
Resolved
|
||
|
|
||
| SHELL ["/bin/ash", "-exo", "pipefail", "-c"] | ||
|
|
||
| RUN if [ "$ENABLED_MODULES" = "" ]; then \ | ||
| echo "No additional modules enabled, exiting"; \ | ||
| exit 1; \ | ||
| fi | ||
|
|
||
| COPY ./ /modules/ | ||
|
kkellerlbl marked this conversation as resolved.
Resolved
|
||
|
|
||
| RUN apk update \ | ||
| && apk add linux-headers openssl-dev pcre2-dev zlib-dev openssl abuild \ | ||
| musl-dev libxslt libxml2-utils make gcc unzip git \ | ||
| xz g++ coreutils curl \ | ||
| # allow abuild as a root user \ | ||
| && printf "#!/bin/sh\\nSETFATTR=true /usr/bin/abuild -F \"\$@\"\\n" > /usr/local/bin/abuild \ | ||
| && chmod +x /usr/local/bin/abuild \ | ||
| && git clone -b ${NGINX_VERSION}-${PKG_RELEASE} https://github.com/nginx/pkg-oss/ \ | ||
| && cd pkg-oss \ | ||
| && mkdir /tmp/packages \ | ||
| && for module in $ENABLED_MODULES; do \ | ||
| echo "Building $module for nginx-$NGINX_VERSION"; \ | ||
| if [ -d /modules/$module ]; then \ | ||
| echo "Building $module from user-supplied sources"; \ | ||
| # check if module sources file is there and not empty | ||
| if [ ! -s /modules/$module/source ]; then \ | ||
| echo "No source file for $module in modules/$module/source, exiting"; \ | ||
| exit 1; \ | ||
| fi; \ | ||
| # some modules require build dependencies | ||
| if [ -f /modules/$module/build-deps ]; then \ | ||
| echo "Installing $module build dependencies"; \ | ||
| apk update && apk add $(cat /modules/$module/build-deps | xargs); \ | ||
| fi; \ | ||
| # if a module has a build dependency that is not in a distro, provide a | ||
| # shell script to fetch/build/install those | ||
| # note that shared libraries produced as a result of this script will | ||
| # not be copied from the builder image to the main one so build static | ||
| if [ -x /modules/$module/prebuild ]; then \ | ||
| echo "Running prebuild script for $module"; \ | ||
| /modules/$module/prebuild; \ | ||
| fi; \ | ||
| /pkg-oss/build_module.sh -v $NGINX_VERSION -f -y -o /tmp/packages -n $module $(cat /modules/$module/source); \ | ||
| BUILT_MODULES="$BUILT_MODULES $(echo $module | tr '[A-Z]' '[a-z]' | tr -d '[/_\-\.\t ]')"; \ | ||
| elif make -C /pkg-oss/alpine list | grep -E "^$module\s+\d+" > /dev/null; then \ | ||
| echo "Building $module from pkg-oss sources"; \ | ||
| cd /pkg-oss/alpine; \ | ||
| make abuild-module-$module BASE_VERSION=$NGINX_VERSION NGINX_VERSION=$NGINX_VERSION; \ | ||
| apk add $(. ./abuild-module-$module/APKBUILD; echo $makedepends;); \ | ||
| make module-$module BASE_VERSION=$NGINX_VERSION NGINX_VERSION=$NGINX_VERSION; \ | ||
| find ~/packages -type f -name "*.apk" -exec mv -v {} /tmp/packages/ \;; \ | ||
| BUILT_MODULES="$BUILT_MODULES $module"; \ | ||
| else \ | ||
| echo "Don't know how to build $module module, exiting"; \ | ||
| exit 1; \ | ||
| fi; \ | ||
| done \ | ||
| && echo "BUILT_MODULES=\"$BUILT_MODULES\"" > /tmp/packages/modules.env | ||
|
|
||
| FROM ${NGINX_FROM_IMAGE} | ||
|
kkellerlbl marked this conversation as resolved.
Resolved
|
||
| RUN --mount=type=bind,target=/tmp/packages/,source=/tmp/packages/,from=builder \ | ||
| . /tmp/packages/modules.env \ | ||
| && for module in $BUILT_MODULES; do \ | ||
| apk add --no-cache --allow-untrusted /tmp/packages/nginx-module-${module}-${NGINX_VERSION}*.apk; \ | ||
| done | ||
|
|
||
| # added from original Dockerfile | ||
| COPY deployment /kb/deployment | ||
|
|
||
| RUN apk update && \ | ||
| apk upgrade && \ | ||
| apk add --no-cache \ | ||
| curl vim htop wget \ | ||
| bash curl vim htop wget \ | ||
| pcre openssl zlib ca-certificates && \ | ||
| rm -rf /var/cache/apk/* | ||
|
|
||
| RUN mkdir -p /etc/nginx/ssl /etc/nginx/conf.d /etc/nginx/sites-enabled /var/log/nginx && \ | ||
| touch /var/log/nginx/access.log /var/log/nginx/error.log | ||
|
|
||
| RUN rm -f /usr/local/openresty/nginx/conf/nginx.conf \ | ||
| /etc/nginx/conf.d/default.conf | ||
|
|
||
| RUN ln -s /usr/local/openresty/nginx/conf/mime.types /etc/nginx/mime.types | ||
|
|
||
|
|
||
| RUN mkdir -p /kb/deployment/bin && \ | ||
| wget -O /tmp/dockerize.tar.gz \ | ||
| https://github.com/kbase/dockerize/raw/master/dockerize-linux-amd64-v0.6.1.tar.gz && \ | ||
| tar xzf /tmp/dockerize.tar.gz -C /tmp && \ | ||
| mv /tmp/dockerize /kb/deployment/bin/ && \ | ||
| rm /tmp/dockerize.tar.gz | ||
|
|
||
| ENTRYPOINT [ "/kb/deployment/bin/dockerize" ] | ||
| RUN mkdir -p /etc/nginx/ssl /etc/nginx/conf.d /etc/nginx/sites-enabled /var/log/nginx && \ | ||
| touch /var/log/nginx/access.log /var/log/nginx/error.log | ||
|
|
||
| RUN rm -f /usr/local/openresty/nginx/conf/nginx.conf \ | ||
| /etc/nginx/conf.d/default.conf | ||
|
|
||
| ##RUN ln -s /usr/local/openresty/nginx/conf/mime.types /etc/nginx/mime.types | ||
| RUN mkdir -p /usr/local/openresty/nginx/conf && \ | ||
| rm /etc/nginx/nginx.conf && \ | ||
| ln -s /usr/local/openresty/nginx/conf/nginx.conf /etc/nginx/nginx.conf | ||
|
kkellerlbl marked this conversation as resolved.
Resolved
|
||
|
|
||
| ENTRYPOINT [ "/kb/deployment/bin/dockerize" ] | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.