multiarch-pipeline-test/Dockerfile

24 lines
836 B
Docker
Raw Permalink Normal View History

2019-06-05 00:28:26 +00:00
# First build arg is to ensure pulling the image from the correct repository
# The following will work with any library image that supports multi-arch
# Other repositories may use tag suffix instead
2019-03-09 01:12:03 +00:00
ARG REPO=library
2020-01-30 19:54:40 +00:00
FROM multiarch/qemu-user-static:4.2.0-2 as qemu-user-static
2020-01-31 00:01:51 +00:00
2020-01-31 00:14:51 +00:00
# On some systems, touching a dummy file in the /usr/bin dir doesn't work
# and instead removes all files previously in the directory. Not sure why
# this is happening. Moving everything to a different directory seems to
# work fine though.
RUN mkdir /qemu && touch /qemu/qemu-x86_64-dummy && cp /usr/bin/qemu-* /qemu/
2020-01-31 00:01:51 +00:00
2019-03-09 01:12:03 +00:00
FROM ${REPO}/python:3-alpine
2019-06-05 00:28:26 +00:00
# This should be the target qemu arch
2019-03-09 01:12:03 +00:00
ARG ARCH=x86_64
2020-01-31 00:14:51 +00:00
COPY --from=qemu-user-static /qemu/qemu-${ARCH}-* /usr/bin/
2019-03-09 01:12:03 +00:00
2019-06-05 00:28:26 +00:00
# Everything below here is just a simple example
2019-03-09 01:12:03 +00:00
RUN echo "OK" > /foo
CMD [ "cat", "/foo" ]