concourse / concourse/docker-image-resource

How to use load_bases in a multi stage build. Add an example.

Open
#279 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-more-information
Dominant language
Go
Stars
162
Forks
250
PR merge metrics
No merged PRs in 30d

Description

Hello!

Problem

I struggle with the documentation. There is an explanation for all the load_* arguments, but there is not an example of how they work together. So, this ticket is intended to improve the documentation.

I try to

I have a multi-stage Dockerfile, and I try to load the dependencies on the build.

Example pipeline
- name: build-multi-stage
  plan:
  - aggregate:
    - get: git-awsome-app
    - get: acme/ui
      params:
        save: true
  - put:  docker-ui
    params:
      build: awesome-app
      build_args:
        ARG DEPENDENCY_IMAGE:  acme/ui
      load_bases:
      - alpine
      - acme/ui
Example Dockerfile

My Docker file is similar to that:

ARG DEPENDENCY_IMAGE=acme/ui
FROM $DEPENDENCY_IMAGE as ui
COPY --from=ui /app/public /app/public

The problem again

That works so far because when I hijack the build task, the dependency image is shown up with docker image. But then the build stops with

pull access denied for null, repository does not exist or may require 'docker login'

Full output

waiting for docker to come up...
Login Succeeded
Loaded image ID: sha256:b4eb356ac79e52ce50c17255e032c34eb3e7a40d3ca5cda5b22720be98be698a
Loaded image ID: sha256:111f36eedc6c0b442ebc26bebd1bdbb1e339d900e727aa5dc01fa2de07742d13
Sending build context to Docker daemon  100.2MB
Step 1/9 : ARG FRONTDESK_IMAGE=registry.netresearch.de/blugento/frontdesk
Step 2/9 : ARG UI_IMAGE=registry.netresearch.de/blugento/ui
Step 3/9 : FROM $UI_IMAGE as ui
pull access denied for null, repository does not exist or may require 'docker login'

Do I need to use load_repsoitory or other steps?
As I said, an example would be great. I have seen that other guys using DockerInDocker for that, but this thems to be overdosed to me.

Sincerely, André

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the documentation covering the load_* arguments, then reproduce the issue using the example pipeline YAML and multi-stage Dockerfile shown here. Document a working combination of load_bases and related parameters, including the expected result for the dependency image, and verify the example avoids the reported pull access denied error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
devops, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.