Closed LKHN closed 3 years ago
@LKHN doing some udpate to build.sh
, we can manage without creating Dockerfile
. Script has TYPE
has necessary to process it
OLD Generation step
cat << EOF > "${OUTPUT_DIR}/Dockerfile"
FROM scratch
ADD ${IMAGE_NAME} /
CMD ["/bin/bash"]
EOF
Proposed
STARTCMD=$( cat <<EOF
CMD ["/bin/bash"]
EOF
)
if [ ${TYPE} == 'init' ]; then
STARTCMD=$( cat <<EOF
CMD ["/bin/init"]
STOPSIGNAL SIGRTMIN+3
EOF
)
fi
if [ ${TYPE} == 'micro' ]; then
STARTCMD=$( cat <<EOF
CMD ["/bin/sh"]
EOF
)
fi
cat << EOF > "${OUTPUT_DIR}/Dockerfile"
FROM scratch
ADD ${IMAGE_NAME} /
${STARTCMD}
EOF
The
init
andmicro
images need different Docker files than default and minimal. reference for init: