docker-image-resource
docker-image-resource copied to clipboard
Docker save on private registry saves port in repository
I am building a docker image from a Dockerfile that has a FROM <private_repository>. To do this I have the following pipeline:
resources:
- name: repo
type: git
source:
uri: <repo>
branch: {{git-branch}}
private_key: {{private-github-key}}
- name: child
type: docker-image
source:
repository: <docker-internal>:443/child
username: {{docker-username}}
password: {{docker-password}}
- name: base
type: docker-image
source:
repository: <docker-internal>:443/base
username: {{docker-username}}
password: {{docker-password}}
jobs:
- name: build-image-from-base
plan:
- get: repo
- get: base
params:
save: true
- put: child
params:
build: repo/ci
load_base: base
With a Dockerfile for child:
FROM <docker-internal>:443/base
# ...
Problem is that FROM image has to include port :443 which causes issue no basic auth credentials if you try to build the Dockerfile from outside of concourse. If I change to FROM <docker-internal>/base as normal, then error occurs in the pipeline: unauthorized: authentication required.
Is there a way I can configure my pipeline so that I can keep FROM <docker-internal>/base in my image? My concern is that my configuration of docker will be too coupled with concourse if I have to keep it as is.
One way to handle this is just to have a task step that manipulates the FROM line in your Dockerfile. Something with sed maybe? Then do the build on the manipulated version.
@novcn have you found a way to overcome the problem?