docker-debian-repository/Dockerfile

61 lines
1.8 KiB
Text
Raw Permalink Normal View History

2016-07-20 10:47:14 +00:00
FROM debian:latest
LABEL maintainer="Glenn Y. Rolland <glenux@glenux.net>"
LABEL contributors="Dmitrii Zolotov <dzolotov@herzen.spb.ru>"
2014-08-12 21:04:26 +00:00
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
2014-08-12 22:34:00 +00:00
# Install supervisor for managing services
RUN apt-get install -q -y supervisor cron openssh-server pwgen reprepro screen vim-tiny nginx
2014-08-12 22:34:00 +00:00
2014-08-13 11:28:11 +00:00
# Configure cron
2014-08-12 22:34:00 +00:00
# Install cron for managing regular tasks
RUN sed -i 's/\(session *required *pam_loginuid.so\)/#\1/' /etc/pam.d/cron
2014-08-13 11:28:11 +00:00
# Install ssh (run/stop to create required directories)
2014-08-12 22:34:00 +00:00
RUN mkdir /var/run/sshd
2014-08-13 11:28:11 +00:00
#RUN service ssh start ; sleep 1
2014-08-13 08:52:22 +00:00
RUN service ssh stop
2014-08-13 11:28:11 +00:00
# Configure reprepro
ADD scripts/reprepro-import.sh /usr/local/sbin/reprepro-import
RUN chmod 755 /usr/local/sbin/reprepro-import
RUN mkdir -p /var/lib/reprepro/conf
ADD configs/reprepro-distributions /var/lib/reprepro/conf/distributions
2021-08-31 14:21:11 +00:00
# reprepro config generator
ADD scripts/create-distros.sh /usr/local/sbin/create-distros
RUN chmod 755 /usr/local/sbin/create-distros
ADD configs/reprepro-distributions.temp /etc/reprepro-distributions.temp
2014-08-13 11:28:11 +00:00
# Configure nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN rm -f /etc/nginx/sites-enabled/default
ADD configs/nginx-default.conf /etc/nginx/sites-enabled/default
# Setup root access
2014-08-13 08:52:22 +00:00
RUN echo "root:docker" | chpasswd
2014-08-12 21:04:26 +00:00
2014-08-13 11:28:11 +00:00
# Configure supervisor
RUN service supervisor stop
ADD configs/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD configs/supervisor-cron.conf /etc/supervisor/conf.d/cron.conf
ADD configs/supervisor-ssh.conf /etc/supervisor/conf.d/ssh.conf
ADD configs/supervisor-nginx.conf /etc/supervisor/conf.d/nginx.conf
# Finalize
2014-08-12 21:04:26 +00:00
ENV DEBIAN_FRONTEND newt
2014-08-13 11:28:11 +00:00
ADD scripts/start.sh /usr/local/sbin/start
RUN chmod 755 /usr/local/sbin/start
2014-08-12 21:04:26 +00:00
VOLUME ["/docker/keys", "/docker/incoming", "/repository"]
2014-08-13 08:52:22 +00:00
2014-08-12 21:04:26 +00:00
EXPOSE 80
EXPOSE 22
2014-08-13 11:28:11 +00:00
CMD ["/usr/local/sbin/start"]