Getting Started with Docker¶
Goal: Install Docker on the server and make a container available behind a reverse proxy.
If you have any questions or feedback, don't hesitate to contact us.
First you have to create a website on your server. A website acts as a reverse proxy and install Docker for you. Every website is type and environment based which means you have to select a particular type (e.g. docker) and environment (e.g. PROD).
- Log in to cockpit.opsone.ch
- Choose your server or create a new one
- Go to websites, and create a new one
- Select website type docker and fill in all settings
According those settings, our automation will setup the server/vhost as required.
Access with SSH¶
On the server you can work with SSH. Due to security reasons, we allow key based logins only.
- If you don’t have an SSH key: Create an SSH key pair
- Add your SSH Public Key in the Cockpit: Either for the whole server or within the website.
- Now you can log in via SSH. Username is your chosen website name, not your own Username.
Wondering why your existing SSH key is not working? Maybe it does not meet our minimum requirements
Run a Docker Image¶
# run your docker container (nginx as example) $ docker run --detach --restart always --publish 127.0.0.1:8080:80 nginx
You can use any free port. In this example we expose our docker container at 127.0.0.1.8080.
For the container to be accessible from the outside via reverse proxy, the selected port must match the one in the cockpit.