Skip to content

Instantly share code, notes, and snippets.

@ryanwoodsmall
Created February 6, 2020 20:43
Show Gist options
  • Save ryanwoodsmall/d0c3146f48d7e7a65e0fdaca480d7056 to your computer and use it in GitHub Desktop.
Save ryanwoodsmall/d0c3146f48d7e7a65e0fdaca480d7056 to your computer and use it in GitHub Desktop.
32-64-dockerfile
FROM i386/centos:7
#FROM centos:7
RUN \
uname -m | sed 's/^/buildhost: /g' \
&& echo '#!/bin/bash' > /entrypoint.sh \
&& if $(bash -c 'set | grep ^HOSTTYPE= | cut -f2 -d=' | grep -q '86$') ; then \
echo 'this is x86' \
&& echo 'linux32 "${@}"' >> /entrypoint.sh ; \
else \
echo 'this is x86_64' \
&& echo 'linux64 "${@}"' >> /entrypoint.sh ; \
fi \
&& chmod 755 /entrypoint.sh \
&& echo done
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash","-il"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment