<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Joseph Yi</title>
    <description>The latest articles on Forem by Joseph Yi (@wellarchitected).</description>
    <link>https://forem.com/wellarchitected</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3667632%2F4be49736-6436-4c7c-af97-4ea2519f9a54.jpg</url>
      <title>Forem: Joseph Yi</title>
      <link>https://forem.com/wellarchitected</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/wellarchitected"/>
    <language>en</language>
    <item>
      <title>Troubleshooting Auth Issues Pulling Multiple Images With BuildKit in Github Actions</title>
      <dc:creator>Joseph Yi</dc:creator>
      <pubDate>Tue, 06 Jan 2026 08:04:28 +0000</pubDate>
      <link>https://forem.com/wellarchitected/troubleshooting-auth-issues-pulling-multiple-images-with-buildkit-2l89</link>
      <guid>https://forem.com/wellarchitected/troubleshooting-auth-issues-pulling-multiple-images-with-buildkit-2l89</guid>
      <description>&lt;p&gt;Just wanted to cut to the chase about an unexpected issue I encountered while migrating to Docker Hardened Images in my GitHub Actions CI pipeline. I was building a multi-stage Dockerfile pulling multiple images from the dhi.io registry when I hit this error:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Error: buildx failed with: ERROR: failed to build: failed to solve: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This was despite having &lt;code&gt;docker/login-action&lt;/code&gt; step configured for &lt;code&gt;dhi.io&lt;/code&gt;, which always reported &lt;code&gt;Login Succeeded!&lt;/code&gt;. What ended up working was directly configuring the &lt;code&gt;docker/setup-buildx-action&lt;/code&gt; (BuildKit) step with dhi.io. This ensures BuildKit's daemon configuration includes the registry before any image pulls occur:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      - name: Setup buildx
        uses: docker/setup-buildx-action@v3
        with:
          buildkitd-config-inline: |
            [registry."dhi.io"]
              mirrors = ["dhi.io"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I was able to reproduce this issue and &lt;a href="https://github.com/josephyi/dhi-gha-troubleshooting" rel="noopener noreferrer"&gt;created a repository&lt;/a&gt; where I demonstrate a &lt;a href="https://github.com/josephyi/dhi-gha-troubleshooting/actions/runs/20741082038/job/59547873256" rel="noopener noreferrer"&gt;failing pipeline&lt;/a&gt; without this configuration and a &lt;a href="https://github.com/josephyi/dhi-gha-troubleshooting/actions/runs/20741082038/job/59547873263" rel="noopener noreferrer"&gt;successful pipeline&lt;/a&gt; with this configuration. In the failing pipeline, I also demonstrated how the first stage will build just fine when targeted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        run: |
          docker buildx build \
            --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test \
            --load \
            --target=builder \
            .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whereas the second stage fails when targeted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        run: |
          docker buildx build \
            --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test \
            --load \
            --target=aot-cache-training-runner \
            .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To be clear, this issue is probably not unique to the dhi.io registry; presumably it would happen with any private registry in multi-stage builds where BuildKit pulls multiple images in parallel. The root cause appears to be a race condition: docker builds can start pulling images before BuildKit's daemon has fully applied the registry configuration from &lt;code&gt;docker/login-action&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here are some takeaways for anyone encountering similar authentication issues:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If docker/login-action succeeds but builds fail with "pull access denied," the issue is likely BuildKit daemon configuration, not credentials&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;buildkitd-config-inline&lt;/code&gt; to explicitly configure registries before builds&lt;/li&gt;
&lt;li&gt;This is especially important for multi-stage builds that pull from multiple private registries in parallel&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Effectively it should look like this in GHA:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      - name: Authenticate to Docker Hardened Image Registry
        uses: docker/login-action@v3
        with:
          registry: someregistry.io
          username: ${{ secrets.REGISTRY_USER }}
          password: ${{ secrets.REGISTRY_PASSWORD }}
      - name: Setup buildx
        uses: docker/setup-buildx-action@v3
        with:
          buildkitd-config-inline: |
            [registry."someregistry.io"]
              mirrors = ["someregistry.io"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As more teams adopt Docker Hardened Images and other enterprise level hardening solutions, understanding this BuildKit configuration quirk will save hours of debugging and get you closer to being well-architected. Feel free to add comments either here or on the &lt;a href="https://github.com/josephyi/dhi-gha-troubleshooting" rel="noopener noreferrer"&gt;sample repository&lt;/a&gt;, especially if it helped!&lt;/p&gt;

</description>
      <category>docker</category>
      <category>githubactions</category>
      <category>devops</category>
    </item>
    <item>
      <title>Hello World!</title>
      <dc:creator>Joseph Yi</dc:creator>
      <pubDate>Wed, 17 Dec 2025 20:17:17 +0000</pubDate>
      <link>https://forem.com/wellarchitected/hello-world-llc</link>
      <guid>https://forem.com/wellarchitected/hello-world-llc</guid>
      <description>&lt;p&gt;I’m giving this a whirl.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
