How to build docker image from github repository

seanlook

In official docs we can see:

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

It just works fine to me. docker-firefox is a repository and has Dockerfile within root dir.
Then I want to buid redis image and exact version 2.8.10 :

# docker build github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10
2014/11/05 16:20:32 Error trying to use git: exit status 128 (Initialized empty Git repository in /tmp/docker-build-git067001920/.git/
error: The requested URL returned error: 403 while accessing https://github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10/info/refs

fatal: HTTP request failed
)

I got error above. What's the right format with build docker image from github repos?

rofrol

docker build uri#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/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Docker: how to build an image from a non-master branch on Github repository

How can I make docker-compose build an image from a remote git repository?

How do I build a program after cloning a repository from github?

Pass Variable From Github Action to Docker image build

How can I save the build result of the Github Actions docker image

How to build a jibri docker image from unstable build?

How to deploy a Docker image from a private repository on Cloud Foundry?

how to get docker-compose to use the latest image from repository

How to build an image on Docker?

How to build war from github and deploy into Wildfly using docker? Is it possible?

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

How to pull a docker image and execute it from github actions

Build docker image from layers

How to control the size of a displayed image in a github repository?

How do I build a docker image from a Sveltekit app

How to include a local language server in a dockerfile and build a docker image from it?

How to build a docker image from an existing flask project?

How to deploy/run a Docker image from a build server

Tagging docker image with tag from git repository

Can I put my docker repository/image on GitHub/Bitbucket?

Can I use a Github repository as the source of a Docker image?

How to push a docker image that has a tag different from docker hub repository?

Build docker image from specific layer of image

How to build docker image with maven?

How to build Docker Image with Fake

docker run and build from github to a local vm?

How to add a Github repository image to its Github-pages webpage?

Pull docker images from a private repository during docker build?

Build Docker image only if Code Repository has been updated (Jenkins)