I really enjoy working with Docker because it gives me more insight into creating and maintaining your own environments, mostly from scratch. I instantly gained a greater appreciation for Ops engineers, package creators, and other engineers who work on low level software. I think what I'm trying to say is that I've made a whole bunch of mistakes and completed an insane amount of Google searches for help.
我真的很喜欢与Docker合作,因为它使我对创建和维护自己的环境(主要是从头开始)有了更多的了解。 我立即对Ops工程师,程序包创建者和其他从事底层软件工作的工程师产生了更大的赞赏。 我想说的是,我犯了很多错误,并完成了疯狂的Google搜索以寻求帮助。
One of the more basic errors I've recently encountered was trying to run a bash script within the container, only to get the following error: env: can't execute 'bash': No such file or directory
. I was under the impression that bash was always a given in Linux machines, but apparently not in alpine
images. The fix was adding the following to my Dockerfile
file:
我最近遇到的最基本的错误之一是试图在容器中运行bash脚本,只是得到以下错误: env: can't execute 'bash': No such file or directory
。 我给人的印象是bash在Linux机器中总是被给定的,但显然不是在alpine
图像中。 该修复程序将以下内容添加到我的Dockerfile
文件中:
RUN apk update && apk add bash
Or if you're in the machine, just run:
或者,如果您在计算机中,请运行:
apk update && apk add bash
That command installs bash and your bash scripts should then work!
该命令将安装bash,然后您的bash脚本应该可以工作了!