/ bin/sh:apt-get:找不到

Hüs*_*mas 76 bash aspell docker dockerfile

我正在尝试将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
Run Code Online (Sandbox Code Playgroud)

我试图在下面的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"]
Run Code Online (Sandbox Code Playgroud)

教程已经过时,所以我无法成功.你能帮助我吗?

Ser*_*rey 224

您使用图像基于Alpine的,因此您无法使用,apt-get因为它是Ubuntu的包管理器.

要解决这个问题,请使用:

apk updateapk add

  • 这是否会破坏使用Alpine开始的原因,还是仍然使Alpine图像显着减轻重量? (11认同)
  • 你是一个救世主! (3认同)

Ven*_*ari 7

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

RUN apk add --update yourPackageName
Run Code Online (Sandbox Code Playgroud)