Manual container creation
From Tech-Wiki
More actions
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