Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipes in private repository with a port number cannot run on (self-hosted) Bitbucket Runners

Aaron.Luo
Contributor
February 6, 2022

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'.

 

1 answer

0 votes
Graham Gatus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 23, 2022

Hi @Aaron.Luo 

We've created a bug for this issue - https://jira.atlassian.com/browse/BCLOUD-21719

Please watch that ticket for updates.

 

Aaron.Luo
Contributor
February 23, 2022

Thanks @Graham Gatus 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events