forked from dokku/dokku
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (59 loc) · 3.28 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
FROM phusion/baseimage:noble-1.0.0
CMD ["/sbin/my_init"]
ARG DOKKU_TAG=0.17.7
ARG DOKKU_GID=200
ARG DOKKU_UID=200
ARG DOKKU_HOSTNAME=dokku.invalid
ARG DOKKU_SKIP_KEY_FILE=true
ARG DOKKU_VHOST_ENABLE=false
ARG DOKKU_WEB_CONFIG=false
RUN addgroup --gid $DOKKU_GID dokku \
&& adduser --uid $DOKKU_UID --gid $DOKKU_GID --disabled-password --gecos "" "dokku"
COPY ./tests/dhparam.pem /tmp/dhparam.pem
COPY ./build/package/ /tmp
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3005,DL3008
RUN mkdir -p /etc/apt/keyrings \
&& mkdir -p /etc/apt/keyrings \
&& apt-get remove -y systemd && apt-get autoremove -y && apt-get update && apt-get install -y --no-install-recommends gpg lsb-release \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& apt-get -y --no-install-recommends install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \
&& echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections \
&& echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | debconf-set-selections \
&& echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | debconf-set-selections \
&& curl -sSL https://packagecloud.io/dokku/dokku/gpgkey | apt-key add - \
&& echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ noble main" | tee /etc/apt/sources.list.d/dokku.list \
&& mkdir -p /etc/nginx/ \
&& cp /tmp/dhparam.pem /etc/nginx/dhparam.pem \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get -y --no-install-recommends --only-upgrade install openssl openssh-server \
&& DOKKU_INIT_SYSTEM=sv apt-get -y --no-install-recommends install rsync "/tmp/dokku-$(dpkg --print-architecture).deb" \
&& apt-get purge -y syslog-ng-core \
&& apt-get autoremove -y \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /tmp
COPY ./docker .
RUN \
rsync -a /tmp/ / \
&& chmod +x /usr/local/bin/* \
&& rm -rf /tmp/* \
&& rm /etc/runit/runsvdir/default/sshd/down \
&& chown -R dokku:dokku /home/dokku/ \
&& mkdir -p /skel/etc /skel/home /skel/var/lib/dokku /var/log/services \
&& mv /etc/ssh /skel/etc/ssh \
&& mv /home/dokku /skel/home/dokku \
&& mv /var/lib/dokku/config /skel/var/lib/dokku/config \
&& mv /var/lib/dokku/data /skel/var/lib/dokku/data \
&& ln -sf /mnt/dokku/etc/ssh /etc/ssh \
&& ln -sf /mnt/dokku/home/dokku /home/dokku \
&& ln -sf /mnt/dokku/var/lib/dokku/config /var/lib/dokku/config \
&& ln -sf /mnt/dokku/var/lib/dokku/data /var/lib/dokku/data \
&& ln -sf /mnt/dokku/var/lib/dokku/services /var/lib/dokku/services \
&& mv /etc/my_init.d/00_regen_ssh_host_keys.sh /etc/my_init.d/15_regen_ssh_host_keys \
&& rm -f /etc/nginx/sites-enabled/default /usr/share/nginx/html/index.html /etc/my_init.d/10_syslog-ng.init \
&& rm -f /usr/local/openresty/nginx/conf/sites-enabled/default /usr/share/openresty/html/index.html \
&& sed -i '/imklog/d' /etc/rsyslog.conf \
&& rm -f /var/log/btmp /var/log/wtmp /var/log/*log /var/log/apt/* /var/log/dokku/*.log /var/log/nginx/* /var/log/openresty/*