Skip to content

Static error pages

Paramtamtam edited this page Jan 28, 2022 · 1 revision

You may want to use the generated error pages somewhere else, and you can simply extract them from the docker image to your local directory for this purpose:

$ docker create --name error-pages tarampampam/error-pages
$ docker cp error-pages:/opt/html ./out
$ docker rm -f error-pages
$ ls ./out
ghost  hacker-terminal  index.html  l7-dark  l7-light  noise  shuffle
$ tree
.
└── out
    β”œβ”€β”€ ghost
    β”‚   β”œβ”€β”€ 400.html
    β”‚   β”œβ”€β”€ ...
    β”‚   └── 505.html
    β”œβ”€β”€ hacker-terminal
    β”‚   β”œβ”€β”€ 400.html
    β”‚   β”œβ”€β”€ ...
    β”‚   └── 505.html
    β”œβ”€β”€ index.html
    β”œβ”€β”€ l7-dark
    β”‚   β”œβ”€β”€ 400.html
    β”‚   β”œβ”€β”€ ...
    ...

Or inside another docker image:

FROM alpine:latest

COPY --from=tarampampam/error-pages /opt/html /error-pages

RUN ls -l /error-pages
$ docker build --rm .

...
Step 3/3 : RUN ls -l /error-pages
 ---> Running in 30095dc344a9
total 12
drwxr-xr-x    2 root     root           326 Sep 29 15:44 ghost
drwxr-xr-x    2 root     root           326 Sep 29 15:44 hacker-terminal
-rw-r--r--    1 root     root         11241 Sep 29 15:44 index.html
drwxr-xr-x    2 root     root           326 Sep 29 15:44 l7-dark
drwxr-xr-x    2 root     root           326 Sep 29 15:44 l7-light
drwxr-xr-x    2 root     root           326 Sep 29 15:44 noise
drwxr-xr-x    2 root     root           326 Sep 29 15:44 shuffle