AlmaLinux / docker-images

Home for AlmaLinux Docker image RootFS files and production version of sources
MIT License
100 stars 27 forks source link

Use specific Dockerfile per image and architecture #25

Closed LKHN closed 3 years ago

LKHN commented 3 years ago

The init and micro images need different Docker files than default and minimal. reference for init:

srbala commented 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