web-dev-qa-db-fra.com

/ bin / sh: apt-get: non trouvé

J'essaie de changer un fichier docker pour qu'il fonctionne avec aspell. J'ai un script bash que je veux envelopper dans un 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

j'essaie de faire cela sur le fichier docker ci-dessous

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

le tutoriel est obsolète donc je ne peux pas réussir à le faire. Pouvez-vous m'aider?

55

Le image que vous utilisez est basé sur Alpine , vous ne pouvez donc pas utiliser apt-get car il s'agit du gestionnaire de paquets d'Ubuntu.

Pour résoudre ce problème, utilisez simplement:

apk update et apk add

173
Serey

Si vous regardez à l'intérieur du fichier de dock lors de la création d'une image.

RUN apk add --update yourPackageName

0