Installing OpenSSH on the Alpine Docker Container

前端 未结 2 1219
孤独总比滥情好
孤独总比滥情好 2021-02-02 05:11

When running the alpine docker container the first time and attempting an openssh install, the following happens:

ole@T:~$ docker run -it --rm alpine /bin/ash
/          


        
2条回答
  •  野性不改
    2021-02-02 05:29

    As the answer is already given but I will add up something.

    In the new version, If you want to install something without caching things locally, which is recommended for keeping your containers small, include the --no-cache flag. Example:

    apk add --no-cache openssh
    

    This is a small gain, it keeps you from having the common rm -rf /var/cache/apk/* at the end of your Dockerfile.

提交回复
热议问题