Automatic Build for StackStorm All-in-One image, built from GitHub repo.
297
git clone https://github.com/StackStorm/st2-docker.git
ST2_PASSWORD variable in the Dockerfile. (You may skip this and stay with default password if you using this image for testing purposes only, for production usage though, you may need to change it).build command to create the docker image and give it a name (in this example we are naming the image stackstorm/stackstorm-all).
. by the path to Dockerfile if you are not in that directory):docker build -t stackstorm/stackstorm-all .
docker images
run command to create the docker image.
-d to indicate detach mode. This will allow to process the build of the image in background, as soon as you type in this command, you'll get the container ID (even if the build will take roughly 10 mn to get done).--rm=true which is helpful for de-provisionning, it will automatically remove the container when you kill it.docker run -d --rm=true --name=my_st2 stackstorm/stackstorm-all
docker logs my_st2 -f
my_st2 or the name you would have used during the instanciation:docker ps
exec command to enter the docker container and type any command.
-it to be in interactive modedocker exec -it my_st2 st2 --version
docker exec -it my_st2 st2 pack list
docker exec -it my_st2 st2 action list
docker exec -it my_st2 bash
For testing purposes you may want to upload data to the container at the moment of its creation. This is very useful if you are working on writing a pack, or components of a pack, and you want to test it.
-v to add a data volume to the container. In the below example your local /opt/stackstorm/packs/my_pack/ directory will be mounted to the directory /opt/stackstorm/packs/my_pack in the containerdocker run -d -v /opt/stackstorm/packs/my_pack/:/opt/stackstorm/packs/my_pack --rm=true --name=my_st2 stackstorm/stackstorm-all
You can check that data have been properly mounted by typing the following command:
docker exec -it my_st2 ls -l my_pack
Please note, that for st2, mounting data to the container at the right even at the right location, is the first step, but that is not enough to use that code. You'll need to go through few steps before being able to use it.
Setting up the virtual environements: st2 run packs.setup_virtualenv packs=my_pack
Register the pack st2ctl restart
Then check if the pack and its actions have been registered: st2 pack list & st2 action list -p my_pack
The UI is available at https://<container_IP>, user 'st2admin' and password the one set in Dockerfile.
Content type
Image
Digest
Size
393.2 MB
Last updated
about 9 years ago
docker pull mab27/docker_st2