Gasim
Gasim

Reputation: 7961

docker-compose doesn't build image from latest commit of git repository

I have a git repository (the repository has Dockerfile and docker-entrypoint.sh) that I use as a context for building in docker-compose:

 build:
      context: [email protected]/example/example-backend.git

When I run either one of the following:

 1. docker-compose build && docker-compose up -d
 2. docker-compose build --no-cache && docker-compose up -d
 3. docker-compose up -d --build

The image is being built from the repository but the files are not up to date with origin/master. They are the one from previous commit.

I checked to see if pulling from git actually works. Doing

 git clone [email protected]/example/example-backend.git

pulls from latest commit.

What am I doing wrong? Docker doesn't work pull it from latest commit in git repository.

Upvotes: 1

Views: 1625

Answers (1)

gpapaz
gpapaz

Reputation: 909

Looks like you have stumbled upon a known missing feature or bug (depending who you ask). You can find out more here. A way to go around this is to use an http(s) url instead of the ssh git one, you try.

Upvotes: 2

Related Questions