Sign inSign up

buluma/docker-centos-openssh

By buluma

Updated over 4 years ago

A Rocky Linux container that runs OpenSSH server.

Image
1

1.5K

buluma/docker-centos-openssh repository overview

Docker Rocky Linux OpenSSH

A Rocky Linux container that runs OpenSSH server.

Maintenance build-push GitHub commits since tagged version Docker Pulls Docker Image Size (latest by date) GitHub issues GitHub closed issues

You can use this container to quickly startup a "machine" and test things, or it can be used as an SSH server, maybe a stepstone.

This container will generate new keys (host and user) at startup if none are loaded by attaching a volume.

Running the container.

It's quite easy to start a container:

docker run -P buluma/docker-centos-openssh

For Podman, please use:

podman run --cap-add AUDIT_WRITE -P buluma/docker-centos-openssh

(The --cap-add AUDIT_WRITE is added to overcome an issue.)

A private key will be displayed, copy-pasts-save it, set the permissions to 0600.

Find out what port Docker has connected to the container:

docker port docker-centos-openssh

And connect to the container:

ssh -p ${port} -i ${savedkey} root@${ip}

The ${ip} depends on where the container is running.

Using your own private key

Simply save your key in a folder like "dot-ssh" and map the volumes:

docker run -P -v $(pwd)/./ssh:/root/.ssh/ buluma/docker-centos-openssh

Using with docker-compose

You may setup a testlab, for example for Ansible or Rundeck, using Docker-compose, like so:

version: '3'
services:
  server:
    image: buluma/docker-centos-openssh
    volumes:
      - /path/to/dot-ssh:/root/.ssh/
    links:
      - client1
      - client2
      - client3
    ports:
      - "2222:22"
  client1:
    image: buluma/docker-centos-openssh
    volumes:
      - /path/to/dot-ssh:/root/.ssh/
  client2:
    image: buluma/docker-centos-openssh
    volumes:
      - /path/to/dot-ssh:/root/.ssh/
  client3:
    image: buluma/docker-centos-openssh
    volumes:
      - /path/to/dot-ssh:/root/.ssh/

Technologies used to build and test

Building on local and publishing to Docker Hub happens in parallel. On local environment, few project are used:

A bit weird about this setup is that when the build fails, an image is still published.

Tag summary

Content type

Image

Digest

Size

76.9 MB

Last updated

over 4 years ago

docker pull buluma/docker-centos-openssh