This is the enroute quickstart tutorial ...
- Developed with bndtools in Eclipse,
- Build with maven on TravisCI
- Containerized to DockerHub
- Docker installed on your local machine
docker pull klibio/io.klib.docker.osgi.tutorial
docker container run -p 8888:8080 klibio/io.klib.docker.osgi.tutorial
Now you can open a webbrowser on http://localhost:8888/quickstart/index.html
docker pull klibio/io.klib.docker.osgi.tutorial
docker container run -p 8888:8080 klibio/io.klib.docker.osgi.tutorial
Now you can open a webbrowser on http://localhost:8888/quickstart/index.html
- Create One-Click Droplet with Docker (preferred with SSH already deposited)
- Login either via root + password or via ssh key
docker pull klibio/io.klib.docker.osgi.tutorial:master-latest
sudo ufw allow 8888/tcp Stackoverflow
docker container run -d -p 8888:8080 klibio/io.klib.docker.osgi.tutorial:master-latest
- Change directory to where your public ssh key file is located
cat <public_key_file> | ssh root@<droplet_ip> "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
- To change this file, login via root and password
cat sshrsa_id_pub | ssh root@<droplet_ip> "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
- Install Azure CLI Install_Page
- Use this command to login
az login -u <username> -p <password>
- Use this command to create/update the container
az container create \
--resource-group <resgrp_name> \
--name <container_name> \
--image klibio/io.klib.docker.osgi.tutorial:develop-latest \
--dns-name-label <name_label> \
--ports 8080
Be careful, as azure container instances do NOT support port mapping. This feature will be implemented, but has not been yet. If you need this feature, a Ubuntu Server will be more usable. The dns contains the name label you desire as suffix. The prefix is determined by the location where you host the container instance on azure (f.e. <name_labe>.westeurope.azurecontainer.io) 4. Wait for the container instance to be published. It will recieve an automatically associated ip and a dns adress. The DNS adress depends on the region in which the instance has been hosted and is unique. 5. now you can connect to either "<dns_name>:8080/quickstart/index.html" or "<ip_adress>:8080/quickstart/index.html"
Example: OSGI Tutorial
To update die container we first delete it and then redeploy it:
az container delete --resource-group klibio --name develop --yes && az container create --resource-group klibio --name develop --image klibio/io.klib.docker.osgi.tutorial:develop-latest --dns-name-label develop --ports 8080