rules_docker
rules_docker copied to clipboard
Unable to push to docker hub. Win10 & WSL
🐞 bug report
Affected Rule
The issue is caused by the rule:Workspace
docker_toolchain_configure(
name = "docker_config",
client_config = "~/.docker/config.json",
)
Build
container_push(
name = "push_docker_hub",
format = "Docker",
image = ":go_image",
registry = "registry.hub.docker.com",
repository = "XXXX/xxxx",
tag = "latest",
)
Is this a regression?
Unsure
Description
I am unable to push to docker hub on WSL and Win10. Before pushing, I made sure I logged in, and can perform push commands to Docker Hub without bazel.
When I attempt to run bazel push image. I get a unauthorized error.
🔬 Minimal Reproduction
Ensure you have the following:
- Docker Desktop (logged in)
- WSL on Windows 10
- Have this rule in
WORKSPACE
load(
"@io_bazel_rules_docker//toolchains/docker:toolchain.bzl",
docker_toolchain_configure = "toolchain_configure",
)
docker_toolchain_configure(
name = "docker_config",
client_config = "~/.docker/config.json",
)
- Have a build target with the following rule
container_push(
name = "push_docker_hub",
format = "Docker",
image = ":go_image",
registry = "registry.hub.docker.com",
repository = "XXXX/xxxx",
tag = "latest",
)
🔥 Exception or Error
Error pushing image to registry.hub.docker.com/XXXX/xxxx:latest: unable to push image to registry.hub.docker.com/XXXX/xxxx:latest: POST https://registry.hub.docker.com/v2/XXXX/user/blobs/uploads/: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:XXXX/user Type:repository] map[Action:push Class: NameXXXX/user Type:repository]]
🌍 Your Environment
Operating System:
Windows 10
Ubuntu WSL
Output of bazel version:
Build label: 5.2.0-homebrew
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jan 1 00:00:00 1980 (315532800)
Build timestamp: 315532800
Build timestamp as int: 315532800
Rules_docker version:
http_archive(
name = "io_bazel_rules_docker",
sha256 = "27d53c1d646fc9537a70427ad7b034734d08a9c38924cc6357cc973fed300820",
strip_prefix = "rules_docker-0.24.0",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.24.0/rules_docker-v0.24.0.tar.gz"],
)
Anything else relevant?