Skip to content

Use api3 as DOCKERHUB_USERNAME in docker-build CI workflow#2035

Merged
dcroote merged 2 commits intomasterfrom
hardcode-dockerhub-username
Oct 21, 2025
Merged

Use api3 as DOCKERHUB_USERNAME in docker-build CI workflow#2035
dcroote merged 2 commits intomasterfrom
hardcode-dockerhub-username

Conversation

@dcroote
Copy link
Contributor

@dcroote dcroote commented Oct 15, 2025

Closes #2034. Note that I didn't hardcode the variable everywhere- there are a a few publishing-related places below that retain it. The reason being that we've sometimes needed to push images to forks for testing and hardcoding api3 wouldn't be ideal, whereas hardcoding it in the CI workflow makes sense.

Other note: the CI docker build step is expected to fail because no changesets that affect packages have been added since the last release (see e.g. #1585 (comment))

"docker:scripts:docker:publish": "docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -e DOCKERHUB_USERNAME -e DOCKERHUB_TOKEN api3/airnode-packaging:latest docker publish",

const loginDockerHub = () => {
const username = process.env.DOCKERHUB_USERNAME;
const password = process.env.DOCKERHUB_TOKEN;
if (!username || !password) {
throw new Error('Missing DockerHub credentials');
}
runCommand(`docker login --password-stdin --username ${username}`, { input: password });
};

and

airnode/docker/README.md

Lines 274 to 289 in 5b5e8c3

You need to provide two environment variables to authenticate against the DockerHub registry:
- `DOCKERHUB_USERNAME` - DockerHub username
- `DOCKERHUB_TOKEN` - DockerHub access token
Example:
```bash
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -e DOCKERHUB_USERNAME -e DOCKERHUB_TOKEN api3/airnode-packaging:latest docker publish
```
You can use a convenience Yarn target for publishing the latest Docker images:
```bash
docker:scripts:docker:publish:latest
```

@dcroote dcroote requested a review from Siegrift October 15, 2025 05:16
@dcroote dcroote self-assigned this Oct 15, 2025
@dcroote dcroote mentioned this pull request Oct 15, 2025
@dcroote dcroote marked this pull request as draft October 15, 2025 05:50
Copy link
Contributor

@Siegrift Siegrift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@dcroote dcroote marked this pull request as ready for review October 21, 2025 00:16
@dcroote dcroote merged commit 42534e3 into master Oct 21, 2025
23 checks passed
@dcroote dcroote deleted the hardcode-dockerhub-username branch October 21, 2025 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hardcode DOCKERHUB_USERNAME to "api3"

2 participants