Skip to content

docker deployment

Stefan Schneider edited this page Oct 4, 2018 · 4 revisions

Docker deployment

Cheat sheet with commands to build and run tng-sdk-project in service mode within a Docker container. Especially with Docker toolbox on Windows.

Build and run container

./pipeline/build/build.sh
# start detached
docker run --rm -d -p 5098:5098 --name tng-sdk-project registry.sonata-nfv.eu:5000/tng-sdk-project
# start attached (prefix with winpty on Windows) - then use separate terminal
docker run --rm -it -p 5098:5098 --name tng-sdk-project registry.sonata-nfv.eu:5000/tng-sdk-project

Attach to running, detached container:

docker attach tng-sdk-project

Get the IP address

$ docker-machine ip default
192.168.99.100

Test connection

curl http://192.168.99.100:5098/api/v1/pings

Add additional terminal inside container

With bash:

# prefix with winpty in Windows
docker exec -it tng-sdk-project bash

With tests:

# prefix with winpty in Windows
docker exec -it tng-sdk-project pytest --tavern-beta-new-traceback

Stop container

docker stop tng-sdk-project