0

I set a CI/CD pipeline with Github workflows. The CI does basically this:

- name: Build and push backend
  uses: docker/build-push-action@v4
  with:
    context: ./backend
    push: true
    tags: ghcr.io/user/repo/backend:latest

While the CD logins to the GitHub registry and then simply executes "docker compose up -d"

The problem is that everytime these pipelines get triggered, I can't see any changes. My docker compose for the example I posted above looks like this:

version: '3.9'
services:
  backend:
    container_name: backend
    restart: always
    image: ghcr.io/user/repo/backend:latest
    environment:
        - MONGODB_URI=${MONGODB_URI}
        - JWT_SECRET_KEY=${JWT_SECRET_KEY}
    networks:
        - network

How can I find out if it's the latest image the one I'm pulling? Does the image get cached somewhere else?

Also, I tried changing the tag of the image and pulling that tag specifically, but that didn't make any difference since I'm stuck in a previous version.

Thanks in advance.

Felipe
  • 47
  • 1
  • 7

1 Answers1

1

Before running docker compose up -d, try running docker compose pull and then start the apps

Ali Kahoot
  • 3,371
  • 2
  • 22
  • 27