facebookresearch / facebookresearch/detectron2

dockerfile makes fresh clone instead of local sources - prevents build of specific version

Open
#4,696 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
34.7k
Forks
7.9k
PR merge metrics
No merged PRs in 30d

Description

When using `docker/Dockerfile` to build a detectron2 image, it downloads a fresh git clone to build it. See https://github.com/facebookresearch/detectron2/blob/115dc5c8bfd434f9a3f5070147d863d9419cfb7e/docker/Dockerfile#L28

Doing it this way prevents from building a specific version of detectron, which prevents:

1. building a specific version: one can't simply `git checkout SOME-VERSION` and build a docker image of it
2. building with local changes: one can't make changes to detectron2 and build a docker image of it

The `Dockerfile` is also included in the source releases. However, when building from those sources it still builds the latest commit instead of the downloaded sources. This is very surprising behaviour.

Instead, I think it should be building whatever is the current source.

## Instructions To Reproduce the Issue:

git checkout c9cf7c91c454
cd docker
docker build -t detectron2:dev-c9cf7c91c454 .

While we `git checkout c9cf7c91c454`, we can see that docker build clones a fresh detectron2 and builds the latest commit (whatever is the latest at that time).

Or, even more surprising:

wget https://github.com/facebookresearch/detectron2/archive/refs/tags/v0.6.tar.gz
tar xzf v0.6.tar.gz
cd detectron2-0.6/docker/
docker build -t detectron2:0.6 # does not actually build from the fresh downloaded sources

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.