diff --git a/Dockerfile b/Dockerfile index fe5660f..1b1f229 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.3 +FROM ubuntu:14.04 MAINTAINER Bryan Latten # Use in multi-phase builds, when an init process requests for the container to gracefully exit, so that it may be committed @@ -10,22 +10,27 @@ ENV SIGNAL_BUILD_STOP=99 \ NOT_ROOT_USER=docker # Create an unprivileged user -RUN adduser -D -S -H $NOT_ROOT_USER +RUN useradd -r -s /bin/false $NOT_ROOT_USER -# IMPORTANT: update is *part* of the upgrade statement to ensure the latest on each build. -# Note: sed/grep replace the less performant, less functional busybox versions -RUN apk update && \ - apk upgrade && \ - apk add \ - sed \ - grep \ +RUN apt-get update && \ + apt-get install -yq \ + openssl \ + ca-certificates \ + software-properties-common \ supervisor \ - nginx \ + nano \ && \ - rm -rf /var/cache/apk/* + rm -rf /var/lib/apt/lists/* -# Overlay the root filesystem from this repo +# Install latest nginx (development PPA is actually mainline development) +RUN add-apt-repository ppa:nginx/development -y && \ + apt-get update -yq && \ + apt-get install -yq nginx \ + && \ + rm -rf /var/lib/apt/lists/* + +# # Overlay the root filesystem from this repo COPY ./container/root / EXPOSE 80 -CMD ["/bin/sh", "/run.sh"] +CMD ["/bin/bash", "/run.sh"] diff --git a/container/root/etc/nginx/nginx.conf b/container/root/etc/nginx/nginx.conf index 6674c42..741838d 100644 --- a/container/root/etc/nginx/nginx.conf +++ b/container/root/etc/nginx/nginx.conf @@ -7,7 +7,7 @@ # add to the run.d/nginx script ############################################################# -user nobody; +user www-data; worker_processes auto; pid /tmp/nginx.pid; diff --git a/container/root/init.sh b/container/root/init.sh index cbf24d4..739acc8 100755 --- a/container/root/init.sh +++ b/container/root/init.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash RUN_SCRIPTS=/run.d STATUS=0 @@ -13,7 +13,7 @@ for file in $RUN_SCRIPTS/*.sh; do echo "[init] executing ${file}" # Note: -e will enforce that any subcommand that fails will fail the entire script run - /bin/sh -e $file + /bin/bash -e $file STATUS=$? # Captures exit code from script that was run diff --git a/container/root/run.d/10-nginx.sh b/container/root/run.d/10-nginx.sh index 52b7044..299251b 100755 --- a/container/root/run.d/10-nginx.sh +++ b/container/root/run.d/10-nginx.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if [[ $SERVER_APP_NAME ]] then diff --git a/container/root/run.sh b/container/root/run.sh index c0239aa..013fdb0 100755 --- a/container/root/run.sh +++ b/container/root/run.sh @@ -1,7 +1,7 @@ -#!/bin/sh +#!/bin/bash # Begin startup sequence -/bin/sh -e /init.sh +/bin/bash -e /init.sh STATUS=$? # Captures exit code from script that was run diff --git a/container/root/worker.sh b/container/root/worker.sh index 5f55576..0a85260 100755 --- a/container/root/worker.sh +++ b/container/root/worker.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Entrypoint for utilizing as a worker pool instead of a web server # Based on configuration, can run multiple instances of a single worker process