first commit
This commit is contained in:
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
FROM ubuntu:latest
|
||||||
|
|
||||||
|
# 设置为阿里的镜像源
|
||||||
|
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
|
||||||
|
RUN sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
|
||||||
|
|
||||||
|
# 清除缓存 并 更新
|
||||||
|
RUN apt-get clean && apt-get update
|
||||||
|
|
||||||
|
# 安装 git 和一些基础工具
|
||||||
|
RUN apt-get install -y sshpass git git-lfs curl
|
||||||
|
|
||||||
|
# 安装nodejs 23版本
|
||||||
|
RUN curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh
|
||||||
|
RUN bash nodesource_setup.sh
|
||||||
|
RUN apt-get install -y nodejs
|
||||||
|
|
||||||
|
# 设置npm镜像地址
|
||||||
|
RUN npm config set registry https://registry.npmmirror.com
|
||||||
|
# 删除 nodejs 安装脚本
|
||||||
|
RUN rm -rf /nodesource_setup.sh
|
||||||
|
|
||||||
|
# 配置git账户和邮箱
|
||||||
|
RUN git config --global user.name "bmy" && git config --global user.email "2271608011@qq.com"
|
||||||
|
# 取消git对ssl证书的验证,让 drone 可以顺利克隆代码
|
||||||
|
RUN git config --global http.sslVerify "false"
|
||||||
|
|
||||||
|
CMD ["/bin/bash"]
|
||||||
|
|
||||||
|
|
||||||
16
命令记录.txt
Normal file
16
命令记录.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
构建打包镜像
|
||||||
|
docker build -t 2271608011/bmygit:v1.2 .
|
||||||
|
|
||||||
|
进入镜像
|
||||||
|
docker run -it 2271608011/bmygit:v1.2 /bin/bash
|
||||||
|
|
||||||
|
登录
|
||||||
|
docker login
|
||||||
|
|
||||||
|
给镜像打 tag
|
||||||
|
docker tag bmy/git:v1.2 2271608011/bmy/git:v1.2
|
||||||
|
|
||||||
|
docker tag <要push的镜像> <传到dockerhub上的路径>
|
||||||
|
|
||||||
|
推送
|
||||||
|
docker push 2271608011/bmygit:v1.2
|
||||||
Reference in New Issue
Block a user