This is based of https://github.com/AbdBarho/stable-diffusion-webui-docker with only some minor changes.
Build and run the image:
export IMAGE_TAG=sd-web-ui-docker
docker build -t $IMAGE_TAG .
DOCKER_BUILDKIT=1 docker run --name sd -p 7860:7860 -d --runtime=nvidia --gpus all $IMAGE_TAG
Check the logs and ensure stable diffusion UI is running:
docker logs sd
You should see a line that shows Running on local URL: http://0.0.0.0:7860
Now you can go to your browser at url http://localhost:7860 and you should see the Stable Diffusion Web UI.