title: How to build a Docker image on a specific architecture with Docker Hub?
body: <p>I have these automated builds on Docker Hub:</p>
  
  <p><a href="https://i.stack.imgur.com/Fg2vl.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Fg2vl.png" alt="docker hub automated builds"></a></p>
  
  <p>And for reference, here are both Dockerfiles:</p>
  
  <ul>
  <li><a href="https://github.com/rfgamaral/docker-gphotos-uploader/blob/master/Dockerfile" rel="noreferrer">https://github.com/rfgamaral/docker-gphotos-uploader/blob/master/Dockerfile</a></li>
  <li><a href="https://github.com/rfgamaral/docker-gphotos-uploader/blob/master/Dockerfile.arm32v7" rel="noreferrer">https://github.com/rfgamaral/docker-gphotos-uploader/blob/master/Dockerfile.arm32v7</a></li>
  </ul>
  
  <p>And here's the build log for the <code>arm32v7</code> build:</p>
  
  <pre><code>Building in Docker Cloud's infrastructure...
  Cloning into '.'...
  Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
  Reset branch 'master'
  Your branch is up-to-date with 'origin/master'.
  Executing build hook...
  Sending build context to Docker daemon 88.06kB
  Step 1/17 : ARG ALPINE_VERSION="3.8"
  Step 2/17 : ARG S6_OVERLAY_VERSION="1.21.7.0"
  Step 3/17 : FROM golang:1.11-alpine${ALPINE_VERSION} AS builder
  1.11-alpine3.8: Pulling from library/golang
  169185f82c45: Pulling fs layer
  34c29055ee42: Pulling fs layer
  29802c64cdfc: Pulling fs layer
  dd82873a5b09: Pulling fs layer
  b711937b138a: Pulling fs layer
  dd82873a5b09: Waiting
  b711937b138a: Waiting
  29802c64cdfc: Verifying Checksum
  29802c64cdfc: Download complete
  34c29055ee42: Verifying Checksum
  34c29055ee42: Download complete
  b711937b138a: Verifying Checksum
  b711937b138a: Download complete
  169185f82c45: Verifying Checksum
  169185f82c45: Download complete
  169185f82c45: Pull complete
  34c29055ee42: Pull complete
  29802c64cdfc: Pull complete
  dd82873a5b09: Verifying Checksum
  dd82873a5b09: Download complete
  dd82873a5b09: Pull complete
  b711937b138a: Pull complete
  Digest: sha256:9657ef82d7ead12e0c88c7f4708e78b50c5fd3c1893ac0f2f0924ab98873aad8
  Status: Downloaded newer image for golang:1.11-alpine3.8
  ---&gt; be1230a1b343
  Step 4/17 : RUN apk update &amp;&amp; apk add --no-cache --virtual build-dependencies git &amp;&amp; go get -u github.com/nmrshll/gphotos-uploader-cli/cmd/gphotos-uploader-cli &amp;&amp; cd /go/src/github.com/nmrshll &amp;&amp; rm -rf gphotos-uploader-cli &amp;&amp; git clone https://github.com/rfgamaral/gphotos-uploader-cli.git --branch docker &amp;&amp; rm -rf oauth2-noserver &amp;&amp; git clone https://github.com/rfgamaral/oauth2-noserver.git --branch docker &amp;&amp; cd gphotos-uploader-cli/cmd/gphotos-uploader-cli &amp;&amp; GOOS=linux GOARCH=amd64 go build -ldflags='-w -s' -o /go/bin/gphotos-uploader-cli &amp;&amp; apk del build-dependencies
  ---&gt; Running in 79c1d68ad8b0
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
  v3.8.2-53-g53558ad6fc [http://dl-cdn.alpinelinux.org/alpine/v3.8/main]
  v3.8.2-53-g53558ad6fc [http://dl-cdn.alpinelinux.org/alpine/v3.8/community]
  OK: 9544 distinct packages available
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
  (1/7) Installing nghttp2-libs (1.32.0-r0)
  (2/7) Installing libssh2 (1.8.0-r3)
  (3/7) Installing libcurl (7.61.1-r1)
  (4/7) Installing expat (2.2.5-r0)
  (5/7) Installing pcre2 (10.31-r0)
  (6/7) Installing git (2.18.1-r0)
  (7/7) Installing build-dependencies (0)
  Executing busybox-1.28.4-r3.trigger
  OK: 19 MiB in 21 packages
  Cloning into 'gphotos-uploader-cli'...
  Cloning into 'oauth2-noserver'...
  (1/7) Purging build-dependencies (0)
  (2/7) Purging git (2.18.1-r0)
  (3/7) Purging libcurl (7.61.1-r1)
  (4/7) Purging nghttp2-libs (1.32.0-r0)
  (5/7) Purging libssh2 (1.8.0-r3)
  (6/7) Purging expat (2.2.5-r0)
  (7/7) Purging pcre2 (10.31-r0)
  Executing busybox-1.28.4-r3.trigger
  OK: 5 MiB in 14 packages
  Removing intermediate container 79c1d68ad8b0
  ---&gt; 17b221a9ee49
  Step 5/17 : FROM amd64/alpine:${ALPINE_VERSION}
  3.8: Pulling from amd64/alpine
  169185f82c45: Already exists
  Digest: sha256:616d0d0ff1583933ed10a7b3b4492899942016c0577d43a1c506c0aad8ab4da8
  Status: Downloaded newer image for amd64/alpine:3.8
  ---&gt; 491e0ff7a8d5
  Step 6/17 : LABEL maintainer="master@ricardoamaral.net"
  ---&gt; Running in e58b7fcdb220
  Removing intermediate container e58b7fcdb220
  ---&gt; c525e340a42d
  Step 7/17 : ARG BUILD_DATE
  ---&gt; Running in 0a9417e1adcd
  Removing intermediate container 0a9417e1adcd
  ---&gt; 9f6c69125803
  Step 8/17 : ARG S6_OVERLAY_VERSION
  ---&gt; Running in 93a8cd6996b9
  Removing intermediate container 93a8cd6996b9
  ---&gt; 6034d93430da
  Step 9/17 : ARG VCS_REF
  ---&gt; Running in 8f6fc7d81c71
  Removing intermediate container 8f6fc7d81c71
  ---&gt; 74180d38dbc0
  Step 10/17 : LABEL org.label-schema.build-date="${BUILD_DATE}" org.label-schema.description="Mass upload media folders to your Google Photos account with this Docker image." org.label-schema.name="rfgamaral/gphotos-uploader" org.label-schema.schema-version="1.0" org.label-schema.vcs-ref="${VCS_REF}" org.label-schema.vcs-url="https://github.com/rfgamaral/docker-gphotos-uploader.git"
  ---&gt; Running in 08cf19c6f46a
  Removing intermediate container 08cf19c6f46a
  ---&gt; 106104e2ef17
  Step 11/17 : ENV GPU_SCHEDULE="0 */8 * * *"
  ---&gt; Running in edea63c892b9
  Removing intermediate container edea63c892b9
  ---&gt; d69ae92742d2
  Step 12/17 : ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-amd64.tar.gz /tmp/
  ---&gt; a7448cda217f
  Step 13/17 : RUN apk update &amp;&amp; apk add --no-cache curl &amp;&amp; tar xzf /tmp/s6-overlay-amd64.tar.gz -C / &amp;&amp; rm -rf /tmp/*
  ---&gt; Running in 5d9ee7e3941d
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
  v3.8.2-53-g53558ad6fc [http://dl-cdn.alpinelinux.org/alpine/v3.8/main]
  v3.8.2-53-g53558ad6fc [http://dl-cdn.alpinelinux.org/alpine/v3.8/community]
  OK: 9544 distinct packages available
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
  (1/5) Installing ca-certificates (20171114-r3)
  (2/5) Installing nghttp2-libs (1.32.0-r0)
  (3/5) Installing libssh2 (1.8.0-r3)
  (4/5) Installing libcurl (7.61.1-r1)
  (5/5) Installing curl (7.61.1-r1)
  Executing busybox-1.28.4-r3.trigger
  Executing ca-certificates-20171114-r3.trigger
  OK: 6 MiB in 18 packages
  Removing intermediate container 5d9ee7e3941d
  ---&gt; 14fc569893de
  Step 14/17 : COPY --from=builder /go/bin/gphotos-uploader-cli /usr/local/bin/gphotos-uploader-cli
  ---&gt; 32fa657de51c
  Step 15/17 : COPY rootfs/ /
  ---&gt; 1639f6e639b4
  Step 16/17 : VOLUME ["/config", "/photos"]
  ---&gt; Running in 440d1d13cd60
  Removing intermediate container 440d1d13cd60
  ---&gt; fd730f9c1ebb
  Step 17/17 : ENTRYPOINT ["/init"]
  ---&gt; Running in 197c889006b2
  Removing intermediate container 197c889006b2
  ---&gt; 4e66fc7b481d
  Successfully built 4e66fc7b481d
  Successfully tagged rfgamaral/gphotos-uploader:latest-arm32v7
  Pushing index.docker.io/rfgamaral/gphotos-uploader:latest-arm32v7...
  Done!
  Build finished
  </code></pre>
  
  <p>As you can see, the log only references <code>amd64</code> and not <code>arm32v7</code> or <code>armhf</code> which are clearly there in the <code>Dockerfile.arm32v7</code> file. Why is Docker Hub changing:</p>
  
  <ul>
  <li><code>arm32v7/alpine:${ALPINE_VERSION}</code> to <code>amd64/alpine:${ALPINE_VERSION}</code></li>
  <li><code>s6-overlay-armhf.tar.gz</code> to <code>s6-overlay-amd64.tar.gz</code></li>
  <li><code>GOARCH=arm GOARM=7</code> to <code>GOARCH=amd64</code></li>
  </ul>
  
  <p>It's like it's using <code>Dockerfile</code> instead of <code>Dockerfile.arm32v7</code> but a) that's not what I've picked for "Dockerfile location" in the automated builds configuration and b) Docker Hub Builds section as a "Dockerfile" tab to show the Dockerfile used for the build and it displays the right one.</p>
  
  <p>Is this a bug on Docker Hub or am I doing something wrong?</p>