This document describes how to use weserv/images with Docker.
Hosted image on GitHub Container Registry
-
Pull and run the
ghcr.io/weserv/images
container.docker run -d -p 8080:80 --shm-size=1gb --name=weserv ghcr.io/weserv/images:5.x
(this maps TCP port 80 in the container to port 8080 on the Docker host)
-
Visit
http://localhost:8080/
. -
Enjoy!
-
Build the container (with a specified nginx version).
docker build --build-arg NGINX_VERSION=1.27.3 -t weserv/images -f docker/Dockerfile .
-
Run the container (same as above, but using the recently built tag).
docker run -d -p 8080:80 --shm-size=1gb --name=weserv weserv/images
-
Visit
http://localhost:8080/
. -
Enjoy!
# bash commands
docker exec -it weserv bash
# Check nginx configuration for correct syntax
docker exec weserv nginx -t
# Reload the nginx configuration file
docker exec weserv nginx -s reload
# Update RPM packages
docker exec weserv dnf update -y
# Check jemalloc configuration
docker exec -e MALLOC_CONF="stats_print:true,stats_print_opts:mdablxeh" weserv bash
# Retrieve an IP Address
docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -f name=weserv -q)
docker inspect $(docker ps -f name=weserv -q) | grep IPAddress
# Access to logs
docker logs weserv
# Check CPU consumption
docker stats
# Stop all containers
docker stop $(docker ps -aq)
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)