Skip to content

explicit-logic/docker-module-7.7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Module 7 - Containers with Docker

This repository contains a demo project created as part of my DevOps studies in the TechWorld with Nana – DevOps Bootcamp.

https://www.techworld-with-nana.com/devops-bootcamp

Demo Project: Deploy Nexus as Docker container

Technologies used: Docker, Nexus, DigitalOcean, Linux

Project Description:

  • Create and Configure Droplet
  • Set up and run Nexus as a Docker container

1. Create an Ubuntu Droplet

Recommended configuration:

  • 8 GB RAM
  • 4 CPUs

Droplet

2. Configure firewall & install dependencies

Update packages and install the required tools:

apt update
apt install net-tools
snap install docker

Note: Open port 8081 in your DigitalOcean firewall (Networking → Firewalls) to access Nexus from a browser.

3. Find the Nexus image on Docker Hub

Navigate to Docker Hub and search for sonatype/nexus3, or go directly to the sonatype/nexus3 page.

4. Create a Docker volume

A named volume ensures Nexus data persists across container restarts:

docker volume create --name nexus-data

5. Run the Nexus container

docker run -d -p 8081:8081 --name nexus -v nexus-data:/nexus-data sonatype/nexus3

Run Nexus Docker image

Note: First startup can take 1–2 minutes. Access Nexus at http://<droplet-ip>:8081.

Verify the container is running:

netstat -lpnt
docker ps

6. Inspect the running container

Check which user is running inside the Nexus container:

docker exec -it nexus /bin/bash
whoami
exit

Inspect the Nexus volume:

docker volume ls
docker inspect nexus-data

Use the Mountpoint path from the inspect output to browse volume contents:

ls /var/snap/docker/common/var-lib-docker/volumes/nexus-data/_data

About

Deploy Nexus as Docker container

Topics

Resources

Stars

Watchers

Forks