Monday, October 7, 2019

Install Docker on Ubuntu 18.04


Motivation

I want to try RocketMQ Cluster with Multi-NameServers/Brokers, but it seems change port of NameServer is not supported...

So want to run 2 NameServers in 2 Docker Containers and bind to different ports for testing.

Simple Note

Install Docker on Ubuntu 18.04 running in VirtualBox

# Uninstall old versions
sudo apt-get remove docker docker-engine docker.io containerd runc

# SET UP THE REPOSITORY
## Update the apt package index
sudo apt-get update

## Install packages to allow apt to use a repository over HTTPS
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

## Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

## Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.
sudo apt-key fingerprint 0EBFCD88

## Use the following command to set up the stable repository
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"


# INSTALL DOCKER ENGINE - COMMUNITY
## Update the apt package index.
sudo apt-get update

## Install the latest version of Docker Engine - Community and containerd, or go to the next step to install a specific version:
sudo apt-get install docker-ce docker-ce-cli containerd.io

## Verify that Docker Engine - Community is installed correctly by running the hello-world image.
sudo docker run hello-world




Reference

Get Docker Engine - Community for Ubuntu

RocketMQ not support modify nameServer port

No comments:

Post a Comment