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]: Using both image: and build: in a Docker Compose service breaks rolling updates #3408

Closed
1 of 2 tasks
vanWittlaer opened this issue Sep 12, 2024 · 2 comments
Closed
1 of 2 tasks

Comments

@vanWittlaer
Copy link

Description

If an image: "image" is specified in a docker compose service together with a build: instruction (meaning "build the container from a dockerfile and store it as "image""), rollback images are not created

Background: We use a docker compose setup, where services reuse images built in previous steps. Thus we do need to use build: and image: tags in one and the same service to be able to refer to the image in a later service.

Note: This might (!) be related to #2824, but my point here is we are using/setting image (!) names, and not container names. IMHO the conclusion in the mentioned discussion might be erroneous.

Minimal Reproduction (if possible, example repository)

Create a resource of type Private Repository with the Docker Compose build pack.

This docker-compose.yml generates a rollback image correctly:

services:
    shell:
        build:
            context: .
            dockerfile: docker/Dockerfile

This docker-compose.yml does not generate a rollback image:

services:
    shell:
        image: local/shell:latest
        build:
            context: .
            dockerfile: docker/Dockerfile

Exception or Error

There is no rollback image stored.

Version

v4.0.0-beta.332

Cloud?

  • Yes
  • No
@LucasBonna
Copy link

im having the same issue!

@vanWittlaer
Copy link
Author

Note that this problem can be circumvented by using tags in lieu of image like this:

build:
  context: .
  dockerfile: docker/Dockerfile
  tags: 
    - 'myimage:latest'

(just learned on discord) - so I'm closing it for now

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants