ps怎么做镜像

1个回答

写回答

发条橙

2022-06-14 10:16

+ 关注

etc
etc

创建Dockerfile:

FROM ubuntu:18.04

# 更新源

RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \

apt-get update -y && \

apt-get install -y wget

# 下载PS安装包并安装

RUN wget -O /tmp/ps.tar.gz https://ps.download.com/file.tar.gz && \

tar -xzf /tmp/ps.tar.gz -C /opt && \

rm /tmp/ps.tar.gz

# 工作目录设置

WORKDIR /opt/ps

# 执行PS命令

CMD ["/opt/ps/bin/ps"]

镜像构建命令:

docker build -t ps:latest .

运行容器命令:

docker run -it ps

举报有用(17分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号