We are testing private pipes with self-hosted Bitbucket Runners. I know we can use docker://my-docker-registry/repo:tag
to refer to a pipe in a private repository in pipelines. But our internal docker repository has a specified port (non 443) configured, so the pipe reference becomes docker://my-internal-docker-registry: port/repo:tag which introduces an issue while running the pipe. Here is an example:
step:
script:
- pipe: docker://my-internal-docker-registry:port/repo:tag
While pipelines runners run the pipe, it runs a `docker container run` command as follows:
docker container run \
--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \
--volume=/usr/local/bin/docker:/usr/local/bin/docker:ro \
--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/my-internal-docker-registry:port/repo:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/nmy-internal-docker-registry:port/repo \
--workdir=$(pwd) \
--label=org.bitbucket.pipelines.system=true \
--env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \
--env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \
--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \
......
--env=DOCKER_HOST="tcp://host.docker.internal:2375" \
--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \
--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/my-internal-docker-registry:port/repo" \
......
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
my-internal-docker-registry:port/repo
which causes an error because of colon (: between my-internal-docker-registry and the port number) in the path of volume mount:
docker: Error response from daemon: invalid volume specification: '/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/my-internal-docker-registry:port/repo:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/my-internal-docker-registry:port/repo'.
See 'docker run --help'.
Hi @Aaron.Luo
We've created a bug for this issue - https://jira.atlassian.com/browse/BCLOUD-21719
Please watch that ticket for updates.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.