Note that the following steps depend on the operating system (OS). Also, while other methods are supported, this example uses the Docker Swarm tool to orchestrate the Black Duck container deployment and installation on a CentOS / Docker CE platform.
To learn how to install Black Duck using Kubernetes, see the guide.
Step 1: To begin setting up Docker, install the required packages and set up the stable repository.
- Install the required utility packages: sudo yum install -y yum-utils device-mapper-persistent-data lvm2
- Set up the stable repository: sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Step 2: Update the yum package index and install the latest version of Docker.
- Update the yum package index to ensure the latest available version of Docker is available: sudo yum makecache fast
- Install Docker: sudo yum install docker-ce docker-ce-cli containerd.io
Step 3: Verify installation with a hello-world image, which runs a test image in a container. When it runs, Docker prints an informational message and then exits.
- Start Docker: sudo systemctl start docker
- Test an image in a container: sudo docker run hello-world
Step 4: Manage Docker as a non-root user so you won’t have to issue a sudo command every time you want to run a docker command. Start by creating a group called docker.
- Add a group: groupadd docker
- Display groups to ensure your group was created: getent group
- Add yourself to the group: usermod -aG docker $USER
- Test that this was successful by running the hello-world image without writing “sudo” before it: docker run hello-world
Step 5: Configure Docker to automatically start when your system reboots: systemctl enable docker
Here are links to more information on installing Docker and Docker Swarm. Now that the Docker architecture has been set up, let’s install Black Duck.