Skip to content

Particle Container Registry auth issues #852

@tomlewis0

Description

@tomlewis0

Description

When running particle app push I get auth issues pulling and pushing from docker hub. This is seemingly due to incorrect auth details which are loaded into the docker config when running the particle command from this url:
https://linux-dist.particle.io/alpha-assets/2ea71ce0afce170affb38d162a1e3460.json

const DOCKER_CONFIG_URL = 'https://linux-dist.particle.io/alpha-assets/2ea71ce0afce170affb38d162a1e3460.json';

When pulling from the image from Docker hub

➜  blueprint-hello-world-node git:(main) ✗ particle app push
Pushing application hello-world-node_p6f9ob to device 422a06000000000089ba32ab...

Building application...
[+] Building 0.8s (3/3) FINISHED                                                                                   docker:particle
 => [internal] load build definition from Dockerfile                                                                          0.0s
 => => transferring dockerfile: 131B                                                                                          0.0s
 => ERROR [internal] load metadata for docker.io/library/node:20                                                              0.8s
 => [auth] library/node:pull token for registry-1.docker.io                                                                   0.0s
------
 > [internal] load metadata for docker.io/library/node:20:
------
Dockerfile:1
--------------------
   1 | >>> FROM node:20
   2 |     WORKDIR /
   3 |     COPY package*.json ./
--------------------
ERROR: failed to build: failed to solve: failed to fetch oauth token: unexpected status from GET request to https://auth.docker.io/token?scope=repository%3Alibrary%2Fnode%3Apull&service=registry.docker.io: 401 Unauthorized
Failed to build container particleapp/hello-world-node:02a86440-2fba-44fb-9df3-81e84be35b59. See the Docker output for details: Command failed with exit code 1: docker --config /home/<USER>/.particle/docker build hello-world-node --platform linux/arm64 --tag particleapp/hello-world-node:02a86440-2fba-44fb-9df3-81e84be35b59

When pushing the container

$ docker --config /home/<USER>/.particle/docker push particleapp/hello-world-node:b19c3b14-c036-4e50-a773-c46fd6185534
The push refers to repository [docker.io/particleapp/hello-world-node]
...
unauthorized: incorrect username or password

Steps to reproduce

  1. Clone a minimal repo: https://github.com/particle-iot/blueprint-hello-world-node
  2. Attempt to build and deploy with particle app push

Expected result

What should happen?

Command authenticates to docker hub using the credentials provided by particle

Actual result

What happened?

unauthorized: incorrect username or password

Environment

Tell us about your setup:

  • OS: MacOS & Ubuntu
  • Node (run node -v): NA
  • NPM (run npm -v): NA
  • Particle CLI (run particle version): 3.39.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions