Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] New 2.18 releases fails to build images when runnig up --build #10574

Closed
CaBazaga opened this issue May 16, 2023 · 2 comments · Fixed by #10575
Closed

[BUG] New 2.18 releases fails to build images when runnig up --build #10574

CaBazaga opened this issue May 16, 2023 · 2 comments · Fixed by #10575
Labels

Comments

@CaBazaga
Copy link

Description

This command: docker compose -f docker-compose-testing.yaml up -d --build was working properly with 2.17 version.
With 2.18 it returns: Error: No such image:

Simplified compose and dockerfile contents to reproduce:

  • docker-compose-testing.yaml file contents:

    services:
      core:
        container_name: Project_Test
        build:
          context: .
          target: base
        image: project_test
        platform: linux/amd64
        environment:
          - MY_ENVARS=my_values
        restart: on-failure
  • Dockerfile file contents:

    FROM python:3.10-alpine as base
    WORKDIR /service
    COPY Pipfile* /service/
    RUN pip install --upgrade pip
    RUN pip install --upgrade wheel
    RUN pip install --no-cache-dir pipenv
    RUN pipenv install --deploy
  • pipfile file contents:
    (Not really required as the problem comes before attempting to build the dockerfile but shared for completeness)

    [[source]]
    url = "https://pypi.org/simple"
    verify_ssl = true
    name = "pypi"
    
    [packages]
    flask = "*"
    
    [dev-packages]
    mypy = "*"
    
    [requires]
    python_version = "3.10"
    

Steps To Reproduce

Deploy latest version of docker compose from repository at a local folder, my_compose while keeping the previous installed version on system:

(Or some other way get both versions installed)

myusername@localhost compose_problem % docker compose version
Docker Compose version v2.17.3
myusername@localhost compose_problem % ./my_compose/docker-compose version
Docker Compose version v2.18.0

With the previously shared files run both docker compose up command on both versions:
(Without a prior build)

myusername@localhost compose_problem % docker compose version
Docker Compose version v2.17.3

myusername@localhost compose_problem % ./my_compose/docker-compose version
Docker Compose version v2.18.0

myusername@localhost compose_problem % ./my_compose/docker-compose -f docker-compose-testing.yaml up -d --build
Error: No such image:

myusername@localhost compose_problem % docker compose -f docker-compose-testing.yaml up -d --build
[+] Building 1.8s (3/3) FINISHED
 => [internal] load .dockerignore                           0.0s
 => => transferring context: 2B                             0.0s
 => [internal] load build definition from Dockerfile        0.0s
 => => transferring dockerfile: 240B
 ...

This example was made on a MAC but same commands -> same behaviour observed on Linux.

Compose Version

Docker Compose version v2.18.0

Docker Environment

No response

Anything else?

No response

@glours
Copy link
Contributor

glours commented May 16, 2023

Hey @CaBazaga
Thanks for the report, I just opened a fix PR, can you test it?

@CaBazaga
Copy link
Author

CaBazaga commented May 16, 2023

Hey @CaBazaga Thanks for the report, I just opened a fix PR, can you test it?

I've built and tested that PR version and seems to work properly now.

Thanks @glours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants