Skip to content
Permalink
Browse files

Multi-stage build

  • Loading branch information...
Cat5TV committed Aug 20, 2019
1 parent df82d5b commit b3a85275fce9db7f789b828ad415177a3cb28d74
@@ -37,6 +37,12 @@ fi
if [ ! -z $1 ]; then
echo $1 > /etc/.nems_hw_model_identifier
fi

if (( $1 == 21 )); then
echo "Moving systemctl to PID-1"

fi

wget -q -O /tmp/hw_model.sh https://raw.githubusercontent.com/Cat5TV/nems-scripts/master/hw_model.sh
chmod +x /tmp/hw_model.sh
/tmp/hw_model.sh
@@ -0,0 +1,8 @@
#!/bin/bash

# Multi-Stage Build
# Thanks to cube8021 for pointing out this feature on Discord
# Done a bit differently here since the stages are all local (not public)

docker build -t nemsprep stage1
docker build -t nemslinux stage2
@@ -4,8 +4,8 @@ ENV container docker
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive

# Setup our data persistence
VOLUME ["/var/log/", "/tmp/"]
# /tmp will be a tmpfs volume
VOLUME ["/tmp/"]

MAINTAINER Robbie Ferguson <nems@category5.tv>

@@ -29,8 +29,6 @@ RUN wget -O /tmp/systemctl.zip https://github.com/gdraheim/docker-systemctl-repl
ln -s /usr/bin/systemctl3.py /bin/systemctl && \
ln -s /usr/bin/systemctl3.py /usr/bin/systemctl

#CMD ["/bin/bash", "-c", "/bin/systemctl"]

RUN /usr/sbin/make-ssl-cert generate-default-snakeoil --force-overwrite

RUN wget --no-check-certificate -O /tmp/nems-prep.sh https://raw.githubusercontent.com/Cat5TV/nems-admin/master/nems-prep.sh && \
@@ -39,6 +37,4 @@ RUN wget --no-check-certificate -O /tmp/nems-prep.sh https://raw.githubuserconte

EXPOSE 22/tcp 80/tcp 443/tcp 2812/tcp 9090/tcp

RUN /root/nems/nems-admin/nems-build.sh 21

ENTRYPOINT ["/usr/bin/systemctl","default","--init"]
File renamed without changes.
@@ -0,0 +1,14 @@
FROM nemsprep:latest

ENV container docker
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive

# /tmp will be a tmpfs volume
VOLUME ["/tmp/"]

MAINTAINER Robbie Ferguson <nems@category5.tv>

ENTRYPOINT ["/usr/bin/systemctl","default","--init"]

RUN /root/nems/nems-admin/nems-build.sh 21

0 comments on commit b3a8527

Please sign in to comment.
You can’t perform that action at this time.