Cloud Native 3 min read

Get Started with Docker: Install, Pull Ubuntu, and Run Hello World

Learn how to install Docker on CentOS, start the service, pull the official Ubuntu image, and launch an interactive container to display a simple 'hello world' message, with step‑by‑step commands and screenshots illustrating each stage of the process.

Java High-Performance Architecture
Java High-Performance Architecture
Java High-Performance Architecture
Get Started with Docker: Install, Pull Ubuntu, and Run Hello World

Goal

Install and start Docker, download an Ubuntu base image, launch a container, and output “hello world”.

Installation

Docker requires a Linux kernel 3.8 or newer. On a CentOS 7 system the Docker package is available in the extras repository, so it can be installed directly with yum: sudo yum install -y docker Docker also runs on CentOS 6 (via EPEL) and on Windows/macOS with a virtual machine and Boot2Docker.

Start the Service

Start Docker, stop or restart it, and verify the installation: sudo service docker start To stop or restart: sudo service docker start | stop Check the version to confirm the daemon is running: docker version The command should display version information for both the client and server.

Download the Image

Pull the official Ubuntu image from Docker Hub: docker pull ubuntu The ubuntu tag refers to the latest version unless a specific tag is supplied.

List the images stored locally:

docker images

Run a Container

Start an interactive Ubuntu container and open a shell: docker run -i -t ubuntu /bin/bash Inside the container you can execute commands. To display “hello world”: echo 'hello world' The output should be:

hello world
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DockerContainerTutorialUbuntuHello World
Java High-Performance Architecture
Written by

Java High-Performance Architecture

Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.