From 78dcded94240206e142dce08b3feefdbbe09b85b Mon Sep 17 00:00:00 2001 From: Patrick Devine Date: Sat, 8 Jun 2019 09:37:57 -0700 Subject: [PATCH] Fix windows cross compilation + README.md files --- README.md | 33 +++++++++++++++++++++++++++++++++ birthday2019/Dockerfile.cross | 2 +- birthday2019/README.md | 3 +-- cheers2019/Dockerfile.cross | 2 +- cheers2019/README.md | 3 +-- 5 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..bc51e82 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ + +Building Docker Doodles +----------------------- + +Building can be done with the original `docker build`, or with the new *BuildKit* application. The new +experimental 'buildx' command, which is in nightly builds as well as in the Docker Engine 19.03 release, +provides a new, albeit familiar front end to BuildKit similar to the original `docker build` command. +BuildKit has some great new added features such as increased performance, and the ability to easily build +cross platform. + +To build for your own platform with the original docker build command, use: + +`cd && docker build -t /doodle: ./` + +To build cross platform, use the `Dockerfile.cross` file, either with *BuildKit* directly, or with *buildx*. +With buildx, you'll first need to create a cross platform `builder` instance with: + +`docker buildx create --use` + +You only need to create one builder instance, and should not need to create new ones with subsequent +builds. To create and push the multi-arch image to Docker Hub, use the command: + +`cd && docker buildx build -f Dockerfile.cross --platform linux/amd64,linux/arm64,linux/arm/v8,linux/s390x,linux/ppc64le,windows/amd64 -t /doodle: --push .` + +This will build the Doodle for these architectures: +* linux/amd64 (64 bit Linux native) +* linux/arm64 (suitable for Amazon EC2 A1 instances) +* linux/arm/v8 (suitable for Raspberry Pi) +* linux/s390x (for mainframe lovers) +* linux/ppc64le (for IBM POWER8 Little Endian) +* windows/amd64 (64 bit Windows native) + + diff --git a/birthday2019/Dockerfile.cross b/birthday2019/Dockerfile.cross index b302607..6552aec 100644 --- a/birthday2019/Dockerfile.cross +++ b/birthday2019/Dockerfile.cross @@ -13,7 +13,7 @@ FROM scratch AS release-linux COPY --from=builder /project/surprise /surprise ENTRYPOINT ["/surprise"] -FROM microsoft/nanoserver AS release-windows +FROM mcr.microsoft.com/windows/nanoserver:1809 AS release-windows COPY --from=builder /project/surprise /surprise.exe ENTRYPOINT ["\\surprise.exe"] diff --git a/birthday2019/README.md b/birthday2019/README.md index aa74b48..222ea75 100644 --- a/birthday2019/README.md +++ b/birthday2019/README.md @@ -6,7 +6,6 @@ Happy Birthday, Docker! March 2019 marks Docker's sixth year, and we thought we'd celebrate it docker-style with a birthday surprise! To try it out, run: -`docker run -it --rm docker/surprise` +`docker run -it --rm docker/doodle:birthday` Complete source can be found [here](https://github.com/docker/doodle). - diff --git a/cheers2019/Dockerfile.cross b/cheers2019/Dockerfile.cross index 8697087..f95e805 100644 --- a/cheers2019/Dockerfile.cross +++ b/cheers2019/Dockerfile.cross @@ -13,7 +13,7 @@ FROM scratch AS release-linux COPY --from=builder /project/cheers /cheers ENTRYPOINT ["/cheers"] -FROM microsoft/nanoserver AS release-windows +FROM mcr.microsoft.com/windows/nanoserver:1809 AS release-windows COPY --from=builder /project/cheers /cheers.exe ENTRYPOINT ["\\cheers.exe"] diff --git a/cheers2019/README.md b/cheers2019/README.md index c3d57fc..eb65301 100644 --- a/cheers2019/README.md +++ b/cheers2019/README.md @@ -7,7 +7,6 @@ It's time for Dockercon SF 2019, and Moby wanted to celebrate it in docker style To try it out, run: -`docker run -it --rm docker/cheers` +`docker run -it --rm docker/doodle:cheers` Complete source can be found [here](https://github.com/docker/doodle). -