Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing OpenSSH on the Alpine Docker Container

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 / # apk add openssh WARNING: Ignoring APKINDEX.d3812b7e.tar.gz: No such file or directory WARNING: Ignoring APKINDEX.bb2c5760.tar.gz: No such file or directory ERROR: unsatisfiable constraints:   openssh (missing):     required by: world[openssh] 

How should openssh be installed?

like image 732
Ole Avatar asked Feb 29 '16 00:02

Ole


People also ask

Does alpine have SSH?

OpenSSH is a popular SSH implementation for remote encrypted login to a machine. OpenSSH defines sshd as the daemon, and ssh as the client program. The openssh package provides OpenSSH on Alpine Linux.

How can I install Docker inside an alpine container?

To install Docker on Alpine Linux, run apk add --update docker openrc. The Docker package is available in the Community repository. Therefore, if apk add fails because of unsatisfiable constraints error, you need to edit the /etc/apk/repositories file to add (or uncomment) a line.

How do I install OpenSSH?

Install OpenSSH using Windows SettingsFirst, click the Start button, then click Settings. Next, click the 'Apps' category. Click the 'Add a feature' '+' at the top of the 'Optional features' window. Scroll down to 'OpenSSH Client', place a checkmark next to it and click the 'Install' button.


1 Answers

Run apk update first. The below paste contains a complete example:

    ole@T:~$ docker run -it --rm alpine /bin/ash     / # apk update     fetch http://dl-4.alpinelinux.org/alpine/v3.3/main/x86_64/APKINDEX.tar.gz     fetch http://dl-4.alpinelinux.org/alpine/v3.3/community/x86_64/APKINDEX.tar.gz     v3.3.1-97-g109077d [http://dl-4.alpinelinux.org/alpine/v3.3/main]     v3.3.1-59-g48b0368 [http://dl-4.alpinelinux.org/alpine/v3.3/community]     OK: 5853 distinct packages available     / # apk add openssh     (1/3) Installing openssh-client (7.1_p2-r0)     (2/3) Installing openssh-sftp-server (7.1_p2-r0)     (3/3) Installing openssh (7.1_p2-r0)     Executing busybox-1.24.1-r7.trigger     OK: 8 MiB in 14 packages 
like image 134
Ole Avatar answered Sep 23 '22 19:09

Ole