我试图改变一个dockerFile与aspell工作。我有一个bash脚本,我想包装在一个码头

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"]

这个教程已经过时了,所以我不知道如何让它工作。我做错了什么?


当前回答

你所使用的映像是基于Alpine的,所以你不能使用apt-get,因为它是Ubuntu的包管理器。

要解决这个问题,只需使用:

Apk更新和Apk添加

其他回答

如果你在创建镜像时查看dockerfile内部,添加这一行:

RUN apk add --update yourPackageName

你所使用的映像是基于Alpine的,所以你不能使用apt-get,因为它是Ubuntu的包管理器。

要解决这个问题,只需使用:

Apk更新和Apk添加