← Back to list

Docker for Beginners: What I Wish I Knew When I Started

When I first heard about Docker, I honestly thought it was something only DevOps people cared about. Containers, images, ports, volumes …

sandudul · 2026-01-30 06:06 · 0 claps · 3.5 min read
#docker #beginner #beginners-guide #oracle-database #oracle-xe
Open on Medium ↗
Wiki topics: ☁️ · DevOps & Cloud

Docker for Beginners: What I Wish I Knew When I Started

When I first heard about Docker, I honestly thought it was something only DevOps people cared about. Containers, images, ports, volumes , it sounded complicated and lowkey intimidating.

But once I actually used Docker for my university work, everything finally clicked.

In this article, I’ll explain Docker in a simple, beginner-friendly way, using a real example I actually used: running Oracle Database (Oracle XE) with Docker.

What is Docker ?

Docker lets you package an application with everything it needs into something called a container.

That means your app runs:

  • The same on your laptop
  • The same on your friend’s laptop
  • The same on a server
  • The same on the cloud

Docker = consistent environments.

Why I Started Using Docker

Before Docker, I had issues like:

  • Installing heavy software locally
  • Version conflicts
  • Databases breaking my system
  • Setup taking HOURS

With Docker, I can run:

  • Oracle Database
  • MySQL
  • SQL Server
  • RStudio
  • Backend servers

without installing them directly on Windows.

Installing Docker

Windows (Docker Desktop)

  1. Go to: ***Docker-Desktop***
  2. Download Docker Desktop for Windows
  3. Run the installer
  4. Enable WSL 2 when prompted (recommended)
  5. Restart your PC if asked
  6. Open Docker Desktop and make sure it’s running

To check installation:

docker --version

If you see a version number, you’re good.

watch this - https://www.youtube.com/watch?v=JBEUKrjbWqg

macOS (Docker Desktop)

  1. Go to: ***Docker-Desktop***
  2. Download Docker Desktop for Mac
  3. Drag Docker to Applications
  4. Open Docker from Applications
  5. Allow permissions if prompted

Check:

docker --version

Run the Official Test Container

This is the most reliable check

docker run hello-world

If Docker is working, you’ll see a message saying:

**Hello from Docker!** This message shows that your installation appears to be working correctly.

This confirms:

  • Docker engine is running
  • You can pull images
  • You can run containers

Docker Hub Account

You can create a free Docker Hub account, but it’s not required for basic use. It’s useful if you want to pull private images or push your own later.

Core Docker Concepts

Image

An image is like a template or blueprint.

Example images:

  • python
  • mysql
  • node
  • gvenzl/oracle-xe

Container

A container is a running instance of an image.

Think: Image = recipe Container = cooked food

Docker file

A Dockerfile is instructions to build your own image.

(For now, using prebuilt images is totally fine.)

Volumes

Volumes store data outside the container, so your database data doesn’t disappear when the container stops.

SUPER important for databases.

Running Oracle XE with Docker

For my database practicals, instead of installing Oracle locally , I used Docker to run Oracle XE.

Here’s the exact kind of command I used:

docker run -d ^
  --name oracle-xe ^
  -p 1521:1521 ^
  -e ORACLE_PASSWORD=UseStrongPassword  ^
  gvenzl/oracle-xe:21-slim

What this actually means :

  • -d → Run in background
  • --name oracle-xe → Name the container
  • -p 1521:1521 → Map Oracle port to my PC
  • -e ORACLE_PASSWORD=... → Set DB password
  • gvenzl/oracle-xe:21-slim → Oracle XE image

After this:

  • Oracle Database is running
  • No local Oracle installation
  • I can connect using SQL Developer / SQL*Plus

Connecting to Oracle from PC

Once the container is running, continue with the following steps :

Step 1: Open SQL Developer

Step 2: Create a New Connection

  1. Click “New Connection”
  2. Fill in the details:
| Field             | What to Enter                                    |

| Connection Name   | Any name (e.g., DockerXE)                        |
| Username          | system (default admin)                           |
| Password          | The password you set in Docker (ORACLE_PASSWORD) |
| Hostname          | localhost                                        |
| Port              | 1521                                             |
| SID / Service Name| XEPDB1                                           |

Tip: Use Service Name = XEPDB1, not SID — this is the default pluggable database in Oracle XE.

Step 3: Test the Connection

  • Click Test
  • If it says Success, you’re good!

Now you can:

  • Run SQL queries
  • Explore tables
  • Practice database assignments
  • Build projects without installing Oracle locally

Step 4: Save & Connect

  • Click Save
  • Click Connect
  • You’re live on Oracle running in Docker

It feels like Oracle is installed locally but it’s actually running inside Docker.

Common Beginner Mistakes (Using Oracle XE as Example)

1. Forgetting to Map the Port

If you forget this:

-p 1521:1521

You won’t be able to connect from SQL Developer.

Your DB is running but invisible.

2. Losing Data Because You Didn’t Use Volumes

If you delete the container, your database is gone.

Better version (with volume):

-v oracle-data:/opt/oracle/oradata

This saves your Oracle data even if the container is removed.

3. Confusing Images and Containers

I used to delete images thinking I deleted containers.

Quick check:

docker ps -a

Containers ≠ Images.

4. Not Stopping Containers Before Deleting Images

Docker will block you if a container is still using the image.

That’s why you see errors like:

image is being used by a container

Correct flow:

docker stop oracle-xe
docker rm oracle-xe
docker rmi gvenzl/oracle-xe:21-slim

Why This is Useful for Students

Using Docker for Oracle helped me:

  • Avoid heavy local installs
  • Reset everything easily
  • Recreate the environment anytime
  • Match lab setups
  • Save time before deadlines

If something breaks:

  • Stop container
  • Remove container
  • Run it again

메타데이터
post_id
cabda5a89b8c
slug
docker-for-beginners-what-i-wish-i-knew-when-i-started-cabda5a89b8c
url
https://medium.com/@sandudul/docker-for-beginners-what-i-wish-i-knew-when-i-started-cabda5a89b8c
canonical_url
https://medium.com/@sandudul/docker-for-beginners-what-i-wish-i-knew-when-i-started-cabda5a89b8c
author_url
https://medium.com/@sandudul
status
ok
fetched_at
2026-08-06 05:50:16