2

alpine容器镜像踩坑

 2 years ago
source link: https://www.ishells.cn/archives/alpine-error
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
alpine容器镜像踩坑

alpine容器镜像踩坑

%E5%A4%B4%E5%83%8F%E4%B8%93%E7%94%A8-410bbf6dd23c4ecfa72a37ab5e293ef6.jpg 20 次访问 2021-07-07
Scroll Down

有需求需要做一个容器镜像,然后为了小巧简便,选择了alpine镜像,第一次使用alpine做基础镜像

然后在构建Dockerfile的时候发现当前目录的可执行文件报错not found,开始我以为COPY指令有问题,一再修改检发现没有问题,然后exec进入容器手动执行也是报错not found。我还把Dockerfile的最佳实践改成一行一行的RUN,只为更清楚的看到错误在哪儿(请忽略我下面截图中的多行RUN,仅为排错)

alpine 报错:

fromalpineerror1.png

fromalpineerror2.png

centos不报错:

fromcentos.png

ubuntu不报错

from_ubuntu.png

于是我意识到问题出在镜像alpine上

alpine 缺少运行的一些库文件

最终答案来源:

1、https://blog.csdn.net/jinhangdev/article/details/105463453

© 本文著作权归作者所有,转载前请务必署名

Post navigation


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK