作者:重庆刮刮匠 | 来源:互联网 | 2023-01-29 14:15
我正在尝试将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"]
教程已经过时,所以我无法成功.你能帮助我吗?
1> Serey..:
您使用的图像是基于Alpine的,因此您无法使用,apt-get
因为它是Ubuntu的包管理器.
要解决这个问题,请使用:
apk update
和 apk add
这是否会破坏使用Alpine开始的原因,还是仍然使Alpine图像显着减轻重量?
你是一个救世主!
2> Venu Gopal T..:
如果在创建映像时正在dockerfile内部查看,请添加以下行:
RUN apk add --update yourPackageName