ubuntu - Docker error: Unable to locate package git -


i'm using image nginx based on dockerfile/ubuntu. on attaching docker container's shell

docker exec -it <container_id> /bin/bash 

i want git pull tried installing git apt unable find package:

root@a71e45d5cd40:/# apt-get install git reading package lists... done building dependency tree        reading state information... done e: unable locate package git 

how can install git image , why missing?


cat /etc/apt/sources.list

deb http://httpredir.debian.org/debian wheezy main deb http://httpredir.debian.org/debian wheezy-updates main deb http://security.debian.org wheezy/updates main deb http://nginx.org/packages/mainline/debian/ wheezy nginx 

cat /etc/apt/sources.list.d/*

cat: /etc/apt/sources.list.d/*: no such file or directory 

apt-cache madison git

n: unable locate package git 

this happening because apt repository not yet updated, common practice clean apt repositories , tmp files after creating image, base image doing.

to fix this, going want run apt-get update prior installing git, practice combine update , install command @ same time bust cache on update if install line changes:

run apt-get update && apt-get install -y git 

using -y convenient automatically answer yes questions.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -