在Node镜像的基础上,安装git
Dockerfile
FROM node:18.15.0-slim
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
echo "deb http://archive.debian.org/debian/ stretch main contrib non-free" >/etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ stretch main contrib non-free" >>/etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian-security/ stretch/updates main contrib non-free" >>/etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian-security/ stretch/updates main contrib non-free" >>/etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian/ stretch-backports main contrib non-free" >>/etc/apt/sources.list
# 安装git
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
执行如下两个命令:
docker build -t harbor.bidr.com.cn/library/node-git:18.15.0-slim .
docker push harbor.bidr.com.cn/library/node-git:18.15.0-slim