Remove base image dependency

This commit is contained in:
dpedu 2015-09-07 23:33:32 -07:00
parent 3fefb167b3
commit c815426c5a
7 changed files with 31 additions and 14 deletions

View File

@ -1,4 +1,4 @@
FROM basessh FROM ubuntu:trusty
MAINTAINER Dave P MAINTAINER Dave P
# Create nexus user # Create nexus user
@ -6,17 +6,24 @@ RUN useradd --create-home nexus ; \
echo "nexus:nexus" | chpasswd echo "nexus:nexus" | chpasswd
# Install nginx # Install nginx
RUN apt-get install -y nginx-light fcgiwrap RUN apt-get update ;\
apt-get install -y nginx-light fcgiwrap supervisor openssh-server cron ;\
mkdir /start.d /nexus /var/run/sshd ;\
chown nexus /nexus
# Configure nginx # Configure nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf ; cp /usr/share/doc/fcgiwrap/examples/nginx.conf /etc/nginx/fcgiwrap.conf RUN echo "daemon off;" >> /etc/nginx/nginx.conf ; cp /usr/share/doc/fcgiwrap/examples/nginx.conf /etc/nginx/fcgiwrap.conf
COPY nginx.conf /etc/supervisor/conf.d/nginx.conf ADD supervisor.conf /etc/supervisor/conf.d/supervisor.conf
COPY fcgiwrap.conf /etc/supervisor/conf.d/fcgiwrap.conf ADD nginx.conf /etc/supervisor/conf.d/nginx.conf
COPY default /etc/nginx/sites-available/default ADD fcgiwrap.conf /etc/supervisor/conf.d/fcgiwrap.conf
COPY clear-sockets /start.d/clear-sockets ADD sshd.conf /etc/supervisor/conf.d/sshd.conf
ADD cron.conf /etc/supervisor/conf.d/cron.conf
ADD default /etc/nginx/sites-available/default
ADD clear-sockets /start.d/clear-sockets
ADD gen-ssh /start.d/gen-ssh
ADD start /start
RUN chmod +x /start.d/clear-sockets RUN chmod +x /start.d/clear-sockets
EXPOSE 80 EXPOSE 80

2
clear-sockets Normal file → Executable file
View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
rm /tmp/fcgiwrap.socket rm -f /tmp/fcgiwrap.socket

3
cron.conf Normal file
View File

@ -0,0 +1,3 @@
[program:cron]
command=/usr/sbin/cron -f
autorestart=true

4
gen-ssh Executable file
View File

@ -0,0 +1,4 @@
# Regenerate ssh key per container
dpkg-reconfigure openssh-server
rm /start.d/gen-ssh

3
sshd.conf Normal file
View File

@ -0,0 +1,3 @@
[program:sshd]
command=/usr/sbin/sshd -D
autorestart=true

10
start Normal file → Executable file
View File

@ -1,14 +1,12 @@
#!/bin/bash #!/bin/bash
if [ ! -f /etc/ssh/sshd_config ]; then # run everything in start.d
# Regenerate ssh key per container find /start.d -type f -executable -exec {} \;
dpkg-reconfigure openssh-server
fi
chown nexus /nexus
# Cleanly kill supervisor when container is stopped # Cleanly kill supervisor when container is stopped
trap 'kill $(jobs -p)' EXIT trap 'kill $(jobs -p)' EXIT
chown nexus /nexus
# start services # start services
supervisord supervisord

2
supervisor.conf Normal file
View File

@ -0,0 +1,2 @@
[supervisord]
nodaemon=true