【发布时间】:2020-08-28 23:19:41
【问题描述】:
我必须使用奇异性来打包我的代码以在学校服务器上运行。
我尝试仅从 python3.6-slim 映像构建一个基本容器,然后还在 %post 部分安装了 python 以进行良好的衡量。
我也尝试了其他一些基础,例如 debian buster 和 ubuntu 20.04。
目前定义文件如下:
Bootstrap: docker
From: ubuntu:20.04
%post
# Downloads the latest package lists (important).
apt-get update -y
# Runs apt-get while ensuring that there are no user prompts that would
# cause the build process to hang.
apt-get update && apt-get install -y --no-install-recommends \
python3.6
每次构建镜像后,我都尝试运行python --version,但它一直坚持:python: not found
我觉得我在文档中遗漏了一些明显的东西,但无法弄清楚我遗漏了什么。建立在官方 Python docker 镜像上的容器如何……没有安装 python?
【问题讨论】:
-
apt-get install -y --no-install-recommends python3.6应该是apt-get install -y --no-install-recommends python3
标签: python docker containers singularity-container