🛠️
Ghoul's Den
WebsiteGhoulsec-Vault
  • Ghoul's Den
  • Index of Tools
  • Index of Links
  • Top Ports
  • Initial Environment Deployment
    • Python3 & Pip Installation
    • Docker 🛳
    • Setting up AWS CLI
    • Msfconsole
    • Netplan configuration & Cloudinit
    • Wordlist Generation - CEWL
    • Apache2 Server
  • Information Gathering & Recon Tools
    • GHDB : Google Hacking Database
    • Sherlock : Social Media Footprinting
    • Nslookup
    • Dig (Domain Information Groper)
    • Recon-ng
    • HTTrack & Web Data Extractor
    • Email Tracker Pro
    • Shodan
    • ARIN Website Registry
  • Network Scanning Enumaration & Vulnerability Detection Tools
    • NMAP & SuperENUM
    • Nmap
      • Target Specification
      • Host Discovery
      • Port Scanning Techniques
      • Port Specification & Scan Order
      • Service Version Detection
      • OS Detection
      • Nmap Scripting Engine
      • Timing & Performance
      • FW / IDS / IPS Evasion
      • Miscellaneous Options
    • Colasoft Packet Builder & Megaping
    • Global Network Inventory
    • LDAP Enumeration > Active Directory Explorer
    • NetBIOS Enumerator
    • SMBEagle
    • RPC Scan
    • Nikto - Web Application Scanner
    • Enum4Linux
  • File Sharing Enumeration
  • Cloud Computing
    • AAD Internals
    • AWS CLI & S3
    • Trivy Scanner
    • S3 Scanner
    • LazyS3
  • Cryptography & stegnography
    • Veracrypt
    • Cryptanalysis Tools
    • Whitespace Cryptography - Snow
    • Creating a Self signed certificate in IIS
    • Steghide & Stegcracker
    • snow
  • Wireless Attacks
    • Aircrack-ng
  • Mobile Attacks
    • PhoneSploit-Pro
    • AndroRAT
    • ADB
  • SQL Injection Vulnerability
    • SQLMap
    • DSSS
  • IOT & OT Hacking
  • Social Engineering
  • Honeypot & IDS
    • Cowrie Honeypot
  • Sniffing & DDos
    • Sniffing
      • Capturing Remote packets using Wireshark
      • Detecting Sniffing using Nmap
    • Denial of Service (Dos & DDos)
      • DDos Protection using DDos Guardian
  • Malware Attacks
  • Password Cracking & Windows exploitation tools
    • Hydra
    • John
    • Hashcat
    • CrackMapExec
    • Impacket
    • Powerview
    • BitsAdmin
    • Rubeus (Kerberoasting) & Winpeas
    • AD-DC Querying
    • mstsc - RDP
  • System hacking & buffer overflow
    • Responder
    • Reverse Shell Generator
    • Clearing Traces
  • Session Hijacking
    • Caido
    • Bettercap
  • Web Servers & Applications
  • Linux Fundamentals
    • Find Command
    • Grep Command
Powered by GitBook
On this page
  1. Initial Environment Deployment

Docker 🛳

PreviousPython3 & Pip InstallationNextSetting up AWS CLI

Last updated 2 months ago

Installation :

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

1. Running a Container

  • Basic Run Command:

    docker run <options> <image>
  • Example: Run a container in detached mode with port mapping:

    docker run -d -p 443:443 --name <name> <docker_image_name>
    • -d: Run container in detached mode.

    • -p 443:443: Map port 443 on the host to port 443 on the container.

2. List Running Containers

  • Command:

    docker ps
    • Lists all running containers.

3. List All Containers (Including Stopped)

  • Command:

    docker ps -a

4. Stopping a Container

  • Command:

    docker stop <container_name_or_id>
    • Stops a running container.

  • Example:

    docker stop python

5. Starting a Container

  • Command:

    docker start <container_name_or_id>

6. Remove a Container

  • Command:

    docker rm <container_name_or_id>

7. Remove a Running Container (Force)

  • Command:

    docker rm -f <container_name_or_id>

8. Viewing Container Logs

  • Command:

    docker logs <container_name_or_id>

9. Run a Container with a Specific Command

  • Example: Running a container with a custom command:

    docker run -d --name mycontainer ubuntu sleep 3600
    • This runs the Ubuntu image and starts the container with the command sleep 3600 (for 1 hour).

10. Building a Docker Image

  • Command:

    docker build -t <image_name> <path_to_dockerfile>
  • Example:

    docker build -t my_image .

11. List All Docker Images

  • Command:

    docker images

12. Remove a Docker Image

  • Command:

    docker rmi <image_name_or_id>

13. Viewing Docker Info

  • Command:

    docker info
    • Displays information about your Docker installation and environment.

14. Accessing a Running Container (Interactive Mode)

  • Command:

    docker exec -it <container_name_or_id> /bin/bash
    • Starts an interactive bash session inside the container.

15. Viewing Docker Version

  • Command:

    docker --version

16. Remove Unused Docker Resources (Images, Containers, Volumes)

  • Command:

    docker system prune

17. Building and Running a Docker Compose Application

  • Command:

    docker-compose up
    • Starts the services defined in docker-compose.yml.

18. Stopping All Containers

  • Command:

    docker stop $(docker ps -q)

19. Accessing a Container's File System

  • Command:

    docker cp <container_name_or_id>:<container_path> <host_path>

20. Viewing Docker Container Statistics

  • Command:

    docker stats
    • Displays real-time statistics about containers' CPU and memory usage.

https://docs.docker.com/engine/install/ubuntu/