简体   繁体   中英

update git version in docker container

I am implementing a node.js application in docker, that needs to make use of the git worktree feature. However, even if I do :

RUN apt-get update && apt-get install -y git=2.10.0

As of the time of this post, no package repos from Debian include a version beyond 2.9. If you need a newer version, you'll need to download and install that from source which is documented on git-scm , or find another repo.

From some other answers (credit to @Alex Karshin), this solution works for me in the Dockerfile

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y git

参见https://askubuntu.com/a/568596/159234

RUN apt-add-repository ppa:git-core/ppa && apt-get update && apt-get install -y git

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM