我想在Linux容器中只安装Git,但是由于“apt-get update”内容太多,浪费了很多时间。有什么有效的办法吗?
最佳答案
我建议使用 alpine Linux,它只有 5MB,使用 git 后,它会变成 20MB 左右。
FROM alpine
RUN apk add --no-cache git
CMD ["git","--version"]
构建
docker build -t my_git .
运行
docker run -it --rm my_git
关于linux - 如何仅在 Docker 上下载 Git?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58392792/