Jump to content
Toggle menu
  • 51 articles
  • 24 files
  • 4 users
  • 750 edits
Tech-Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Manual container creation

From Tech-Wiki


Create a small custom Docker image and run it directly or with the current Docker Compose plugin.

ⓘ
Validation status
Modernised on 27 September 2026. The original Debian Jessie/PHP 5 example is obsolete and has been replaced with a minimal current pattern.
!
Maintain the base image
Container images inherit vulnerabilities and lifecycle constraints from their base image and packages. Use a supported base image, rebuild regularly, and scan the resulting image.

Example Dockerfile

FROM debian:bookworm-slim

RUN apt-get update \
    && apt-get install -y --no-install-recommends apache2 ca-certificates curl \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /var/www/html
COPY ./site/ /var/www/html/

EXPOSE 80
CMD ["apachectl", "-D", "FOREGROUND"]

Build it:

>_Build the image
docker build -t techwiki-web:latest .

Run it:

>_Run the container
docker run --rm -d --name techwiki-web -p 8080:80 techwiki-web:latest

Compose example

services:
  web:
    build: .
    restart: unless-stopped
    ports:
      - "8080:80"
>_Start with Docker Compose
docker compose up -d

Official references