Skip to content

Docker

Export Docker Image

docker save image:tag > image.tar

You can also compress the image:

gzip image.tar

Prepare a Docker Container as a Remote Server

Reference

Take Ubuntu-based image as an example,

Start a container with port forwarding:

docker run -d -p 2222:22 sshd-image

In the docker container:

apt update && apt install openssh-server

Allow ssh as a root user:

sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

Then reset a password:

passwd

Start openssh server:

service ssh start