build: Optimize Dockerfile (#64)
This commit is contained in:
parent
ec7df3a74c
commit
37960741f4
1 changed files with 18 additions and 18 deletions
36
Dockerfile
36
Dockerfile
|
@ -1,16 +1,20 @@
|
||||||
FROM debian:trixie-slim
|
FROM debian:trixie-slim
|
||||||
|
|
||||||
ARG DEBCONF_NOWARNINGS "yes"
|
ARG VERSION_ARG="0.0"
|
||||||
ARG DEBIAN_FRONTEND "noninteractive"
|
ARG VERSION_VNC="1.4.0"
|
||||||
ARG DEBCONF_NONINTERACTIVE_SEEN "true"
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
ARG DEBCONF_NOWARNINGS="yes"
|
||||||
|
ARG DEBIAN_FRONTEND="noninteractive"
|
||||||
|
ARG DEBCONF_NONINTERACTIVE_SEEN="true"
|
||||||
|
|
||||||
|
RUN set -eu && \
|
||||||
|
apt-get update && \
|
||||||
apt-get --no-install-recommends -y install \
|
apt-get --no-install-recommends -y install \
|
||||||
tini \
|
tini \
|
||||||
wget \
|
wget \
|
||||||
nginx \
|
nginx \
|
||||||
procps \
|
procps \
|
||||||
seabios \
|
seabios \
|
||||||
iptables \
|
iptables \
|
||||||
iproute2 \
|
iproute2 \
|
||||||
apt-utils \
|
apt-utils \
|
||||||
|
@ -22,24 +26,23 @@ RUN apt-get update && \
|
||||||
qemu-system-arm \
|
qemu-system-arm \
|
||||||
qemu-efi-aarch64 && \
|
qemu-efi-aarch64 && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
novnc="1.4.0" && \
|
|
||||||
mkdir -p /usr/share/novnc && \
|
mkdir -p /usr/share/novnc && \
|
||||||
wget https://github.com/novnc/noVNC/archive/refs/tags/v"$novnc".tar.gz -O /tmp/novnc.tar.gz -q && \
|
wget "https://github.com/novnc/noVNC/archive/refs/tags/v${VERSION_VNC}.tar.gz" -O /tmp/novnc.tar.gz -q --timeout=10 && \
|
||||||
tar -xf /tmp/novnc.tar.gz -C /tmp/ && \
|
tar -xf /tmp/novnc.tar.gz -C /tmp/ && \
|
||||||
cd /tmp/noVNC-"$novnc" && \
|
cd "/tmp/noVNC-${VERSION_VNC}" && \
|
||||||
mv app core vendor package.json *.html /usr/share/novnc && \
|
mv app core vendor package.json *.html /usr/share/novnc && \
|
||||||
unlink /etc/nginx/sites-enabled/default && \
|
unlink /etc/nginx/sites-enabled/default && \
|
||||||
sed -i 's/^worker_processes.*/worker_processes 1;/' /etc/nginx/nginx.conf && \
|
sed -i 's/^worker_processes.*/worker_processes 1;/' /etc/nginx/nginx.conf && \
|
||||||
|
echo "$VERSION_ARG" > /run/version && \
|
||||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
ADD https://raw.githubusercontent.com/qemus/qemu-docker/master/web/index.html /var/www/index.html
|
COPY --chmod=755 ./src /run/
|
||||||
ADD https://raw.githubusercontent.com/qemus/qemu-docker/master/web/js/script.js /var/www/js/script.js
|
|
||||||
ADD https://raw.githubusercontent.com/qemus/qemu-docker/master/web/css/style.css /var/www/css/style.css
|
|
||||||
ADD https://raw.githubusercontent.com/qemus/qemu-docker/master/web/img/favicon.svg /var/www/img/favicon.svg
|
|
||||||
ADD https://raw.githubusercontent.com/qemus/qemu-docker/master/web/nginx.conf /etc/nginx/sites-enabled/web.conf
|
|
||||||
|
|
||||||
COPY ./src /run/
|
ADD --chmod=664 https://raw.githubusercontent.com/qemus/qemu-docker/master/web/index.html /var/www/index.html
|
||||||
RUN chmod +x /run/*.sh && chmod 755 -R /var/www/
|
ADD --chmod=664 https://raw.githubusercontent.com/qemus/qemu-docker/master/web/js/script.js /var/www/js/script.js
|
||||||
|
ADD --chmod=664 https://raw.githubusercontent.com/qemus/qemu-docker/master/web/css/style.css /var/www/css/style.css
|
||||||
|
ADD --chmod=664 https://raw.githubusercontent.com/qemus/qemu-docker/master/web/img/favicon.svg /var/www/img/favicon.svg
|
||||||
|
ADD --chmod=744 https://raw.githubusercontent.com/qemus/qemu-docker/master/web/nginx.conf /etc/nginx/sites-enabled/web.conf
|
||||||
|
|
||||||
VOLUME /storage
|
VOLUME /storage
|
||||||
EXPOSE 22 5900 8006
|
EXPOSE 22 5900 8006
|
||||||
|
@ -49,7 +52,4 @@ ENV RAM_SIZE "1G"
|
||||||
ENV DISK_SIZE "16G"
|
ENV DISK_SIZE "16G"
|
||||||
ENV BOOT "http://example.com/image.iso"
|
ENV BOOT "http://example.com/image.iso"
|
||||||
|
|
||||||
ARG VERSION_ARG "0.0"
|
|
||||||
RUN echo "$VERSION_ARG" > /run/version
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"]
|
ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"]
|
||||||
|
|
Loading…
Reference in a new issue