An outline and some examples on how to build a docker image for xks-proxy
and how the image can be run in a docker container. This document assumes you have docker installed.
-
Under the project directory:
docker build -t xks-proxy:latest .
-
Save the image to a tar file, if it needs to be exported/shared:
docker save -o xks-proxy-docker-v3.1.2.tar xks-proxy:latest
-
Compress
xks-proxy-docker-v3.1.2.tar
intoxks-proxy-docker-v3.1.2.tar.xz
if necessary:xz -z -0 xks-proxy-docker-v3.1.2.tar
-
Decompress
xks-proxy-docker-v3.1.2.tar.xz
toxks-proxy-docker-v3.1.2.tar
if necessary:xz -d xks-proxy-docker-v3.1.2.tar.xz
-
Load the docker image if necessary:
docker load -i xks-proxy-docker-v3.1.2.tar
-
Run
xks-proxy
in a docker container exposing port80
(of the container) as port80
on the running host:docker run --name xks-proxy -d -p 0.0.0.0:80:80 xks-proxy:latest
-
Now you can access it at
http://<your hostname>/example/uri/path/prefix/kms/xks/v1
or whatever URI path you've configured insettings.toml
.
-
Remove the
xks-proxy
docker image:docker rmi xks-proxy:latest
-
Exec into the
xks-proxy
docker container:docker exec -it xks-proxy bash
-
List docker images:
docker images
-
List docker containers:
docker container ls
-
Ping
xks-proxy
running in docker container# should get back a "pong from xks-proxy v3.1.2" response curl http://localhost/ping
-
Follow the log of the running
xks-proxy
in the docker containerdocker logs -f xks-proxy