How to build docker image from github repository

后端 未结 3 1328
囚心锁ツ
囚心锁ツ 2021-01-31 08:24

In official docs we can see:

# docker build github.com/creack/docker-firefox

It just works fine to me. docker-firefox is a reposit

3条回答
  •  一生所求
    2021-01-31 09:00

    docker build url#ref:dir

    Git URLs accept context configuration in their fragment section, separated by a colon :. The first part represents the reference that Git will check out, this can be either a branch, a tag, or a commit SHA. The second part represents a subdirectory inside the repository that will be used as a build context.

    For example, run this command to use a directory called docker in the branch container:

    docker build https://github.com/docker/rootfs.git#container:docker
    

    https://docs.docker.com/engine/reference/commandline/build/

提交回复
热议问题