Remove base image dependency
This commit is contained in:
parent
3fefb167b3
commit
c815426c5a
21
Dockerfile
21
Dockerfile
@ -1,4 +1,4 @@
|
||||
FROM basessh
|
||||
FROM ubuntu:trusty
|
||||
MAINTAINER Dave P
|
||||
|
||||
# Create nexus user
|
||||
@ -6,17 +6,24 @@ RUN useradd --create-home nexus ; \
|
||||
echo "nexus:nexus" | chpasswd
|
||||
|
||||
# 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
|
||||
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
|
||||
COPY fcgiwrap.conf /etc/supervisor/conf.d/fcgiwrap.conf
|
||||
COPY default /etc/nginx/sites-available/default
|
||||
COPY clear-sockets /start.d/clear-sockets
|
||||
ADD supervisor.conf /etc/supervisor/conf.d/supervisor.conf
|
||||
ADD nginx.conf /etc/supervisor/conf.d/nginx.conf
|
||||
ADD fcgiwrap.conf /etc/supervisor/conf.d/fcgiwrap.conf
|
||||
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
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
|
2
clear-sockets
Normal file → Executable file
2
clear-sockets
Normal file → Executable file
@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
rm /tmp/fcgiwrap.socket
|
||||
rm -f /tmp/fcgiwrap.socket
|
||||
|
||||
|
3
cron.conf
Normal file
3
cron.conf
Normal file
@ -0,0 +1,3 @@
|
||||
[program:cron]
|
||||
command=/usr/sbin/cron -f
|
||||
autorestart=true
|
4
gen-ssh
Executable file
4
gen-ssh
Executable file
@ -0,0 +1,4 @@
|
||||
# Regenerate ssh key per container
|
||||
dpkg-reconfigure openssh-server
|
||||
|
||||
rm /start.d/gen-ssh
|
3
sshd.conf
Normal file
3
sshd.conf
Normal file
@ -0,0 +1,3 @@
|
||||
[program:sshd]
|
||||
command=/usr/sbin/sshd -D
|
||||
autorestart=true
|
10
start
Normal file → Executable file
10
start
Normal file → Executable file
@ -1,14 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -f /etc/ssh/sshd_config ]; then
|
||||
# Regenerate ssh key per container
|
||||
dpkg-reconfigure openssh-server
|
||||
fi
|
||||
|
||||
chown nexus /nexus
|
||||
# run everything in start.d
|
||||
find /start.d -type f -executable -exec {} \;
|
||||
|
||||
# Cleanly kill supervisor when container is stopped
|
||||
trap 'kill $(jobs -p)' EXIT
|
||||
|
||||
chown nexus /nexus
|
||||
|
||||
# start services
|
||||
supervisord
|
||||
|
2
supervisor.conf
Normal file
2
supervisor.conf
Normal file
@ -0,0 +1,2 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
Loading…
Reference in New Issue
Block a user