alpine-docker / git

A useful simple git container running in alpine linux, especially for tiny linux distro, such as RancherOS, which don't have package manager.
Apache License 2.0
155 stars 86 forks source link

Can not clone repository #43

Closed felipefariasdasilva closed 2 years ago

felipefariasdasilva commented 2 years ago

hey!!

i am trying to use "apline/git" image to clone a repository, however I am getting this error:

Cloning into 'my-repository'...
fatal: unable to access 'https://github.com/my-repository.git/': Could not resolve host: github.com

and it is my dockerfile

FROM alpine/git as clone
WORKDIR /app
RUN git clone https://${TOKEN}@github.com/${ORGANIZATION}/${REPOSITORY}.git

could anybody help me? tks!!

ozbillwang commented 2 years ago

I would not recommend to put any Token in docker images.

can you run below command to clone it?

alias git="docker run -ti --rm -v $(pwd):/git -v $HOME/.ssh:/root/.ssh alpine/git"
git clone https://${TOKEN}@github.com/${ORGANIZATION}/${REPOSITORY}.git
ozbillwang commented 2 years ago

close with no reply