-
Notifications
You must be signed in to change notification settings - Fork 63
/
Dockerfile
87 lines (71 loc) · 2.55 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#------------------------------------------------------------------------
# Dynamic iPXE image generator
#
# Copyright (C) 2012-2021 Francois Lacroix. All Rights Reserved.
# License: GNU General Public License version 3 or later; see LICENSE.txt
# Website: http://ipxe.org, https://github.com/xbgmsharp/ipxe-buildweb
#------------------------------------------------------------------------
#
# Ubuntu LTS + Apache2 + module + my app
#
# Base from ultimate-seed Dockerfile
# https://github.com/pilwon/ultimate-seed
#
# AUTHOR: [email protected]
# WEBSITE: https://github.com/xbgmsharp/ipxe-buildweb
#
# DOCKER-VERSION 1.0.0
# VERSION 0.0.1
# Pull base image.
FROM ubuntu:latest
MAINTAINER Francois Lacroix <[email protected]>
# Setup system and install tools
#RUN echo "initscripts hold" | dpkg --set-selections
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN echo 'alias ll="ls -lah --color=auto"' >> /etc/bash.bashrc
# Make sure the package repository is up to date
RUN apt-get update && apt-get -yq upgrade
# Set locale
RUN apt-get -qqy install locales
#RUN locale-gen --purge en_US en_US.UTF-8
#RUN dpkg-reconfigure locales
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
ENV LC_ALL en_US.UTF-8
# Set ENV
ENV HOME /root
ENV DEBIAN_FRONTEND noninteractive
# Install SSH
RUN apt-get install -y openssh-server
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
RUN sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config
RUN sed 's/#PermitRootLogin yes/PermitRootLogin yes/' -i /etc/ssh/sshd_config
RUN sed 's/PermitRootLogin without-password/PermitRootLogin yes/' -i /etc/ssh/sshd_config
RUN mkdir /var/run/sshd
RUN echo 'root:admin' | chpasswd
# Add the install script in the directory.
ADD install.sh /tmp/install.sh
ADD start.sh /etc/start.sh
#ADD . /app
# Install it all
RUN \
bash /tmp/install.sh
# Define environment variables
ENV PORT 80
# Define working directory.
WORKDIR /var/www/ipxe-buildweb
# Define default command.
# Start ssh and other services.
#CMD ["/bin/bash", "/tmp/install.sh"]
# Expose ports.
EXPOSE 22 80
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Make sure the package repository is up to date
ONBUILD apt-get update && apt-get -yq upgrade
ONBUILD apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN chmod +x /var/www/ipxe-buildweb/install.sh
RUN chmod +x /etc/start.sh
#RUN /etc/init.d/apache2 start
#ENTRYPOINT ["/usr/bin/tail","-f","/var/log/apache2/access.log"]
ENTRYPOINT ["/etc/start.sh"]