bash -/bin/sh : apt-get: not found

标签 bash docker dockerfile aspell

我正在尝试更改 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"]

该教程已过时,因此我无法弄清楚如何使其工作。我做错了什么?

最佳答案

image you're usingAlpine based , 所以你不能使用 apt-get 因为它是 Ubuntu 的包管理器。

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

apk updateapk add

关于bash -/bin/sh : apt-get: not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45142855/

相关文章:

linux - 在 Linux 上删除除 .git 目录和 .gitignore 之外的所有内容

macos - 您将如何从终端获取网页源?

bash - 从特定行开始在文件中插入行

docker - Anchore Engine 是否支持从 DockerHub 扫描本地 Docker 镜像/私有(private) Docker 镜像中的漏洞?

Docker - 没有这样的文件或目录。复制不会复制所有文件

docker - 为什么 docker 需要构建所有前面的阶段?

linux - 过滤文件名中嵌入时间戳的文件

docker - 使用预编译文件创建 Docker 镜像

docker - 当进程成为僵尸时,Monit不清除pid文件并重新启动进程

docker-compose up 问题使用 Docker Apple M1