Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash /bin/sh:apt-get:未找到_Bash_Docker_Dockerfile_Aspell - Fatal编程技术网

Bash /bin/sh:apt-get:未找到

Bash /bin/sh:apt-get:未找到,bash,docker,dockerfile,aspell,Bash,Docker,Dockerfile,Aspell,我正在尝试更改dockerFile以使用aspell。我有一个bash脚本,我想用dock包装它 Step 4: Wrap the script in a Docker container. The sample SDK we downloaded earlier contains an example of an action wrapped in a Docker container. In particular, the sample SDK includes a Dockerfile

我正在尝试更改dockerFile以使用aspell。我有一个bash脚本,我想用dock包装它

Step 4: Wrap the script in a Docker container.

The sample SDK we downloaded earlier contains an example of an action wrapped in a Docker container. In particular, the sample SDK includes a Dockerfile that builds the C program in client/example.c and installs the binary as /blackbox/client/action .

The key line in the sample Dockerfile is:

RUN cd /blackbox/client; gcc -o action example.c

Instead of compiling example.c and installing the binary as an action, we’ll change the Dockerfile to install aspell into the Linux environment, and then install our action.sh script as the executable action command.

To do so, we delete the RUN command above, and insert the following commands into the Dockerfile:

RUN apt-get install -y aspell
RUN rm -f /blackbox/client/action
ADD action.sh /blackbox/client/action
我正试图在下面的dockerfile上这样做

# Dockerfile for example whisk docker action
FROM openwhisk/dockerskeleton

ENV FLASK_PROXY_PORT 8080

### Add source file(s)
ADD example.c /action/example.c

RUN sudo apt-get install -y aspell
RUN rm -f /blackbox/client/action
ADD action.sh /blackbox/client/action



CMD ["/home/huseyin/bin", "-c", "cd actionProxy && python -u actionproxy.py"]
教程已经过时了,所以我做不成功。你能帮我吗?

是的,所以你不能使用
apt-get
,因为它是Ubuntu的包管理器

要解决此问题,请使用:


apk update
apk add

如果在创建图像时查看dockerfile内部,请添加以下行:

RUN apk add --update yourPackageName

docker容器不是基于Debian的?如果它不是基于Debian的,apt软件包管理将不起作用。我当时处于一个非常愚蠢的位置,基本上与当前的问题无关,但也许可以拯救另一个登陆这里的谷歌用户——当我打算运行
docker run ubuntu:latest时,我运行了
docker run-it ubuntu:latest
。我以为我正在容器内运行apt get,但实际上它在Mac终端中。哎呀。这是否破坏了开始使用Alpine的理由,或者它仍然保持Alpine图像相当轻的重量?如何更改下面的命令?