Skip to content

Commit

Permalink
Merge pull request #23 from bryanlatten/feature-ubuntu-base
Browse files Browse the repository at this point in the history
Dockerfile: revert to ubuntu
  • Loading branch information
Bryan Latten committed Feb 23, 2016
2 parents 64409dc + b563109 commit 9c7e204
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 20 deletions.
31 changes: 18 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.3
FROM ubuntu:14.04
MAINTAINER Bryan Latten <latten@adobe.com>

# Use in multi-phase builds, when an init process requests for the container to gracefully exit, so that it may be committed
Expand All @@ -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"]
2 changes: 1 addition & 1 deletion container/root/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# add to the run.d/nginx script
#############################################################

user nobody;
user www-data;
worker_processes auto;

pid /tmp/nginx.pid;
Expand Down
4 changes: 2 additions & 2 deletions container/root/init.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

RUN_SCRIPTS=/run.d
STATUS=0
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion container/root/run.d/10-nginx.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

if [[ $SERVER_APP_NAME ]]
then
Expand Down
4 changes: 2 additions & 2 deletions container/root/run.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion container/root/worker.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 9c7e204

Please sign in to comment.