Docker Image Examples

Lattice supports docker images. Lattice containers currently use ephemeral disk and therefore are only suitable for running workloads that can have persistent disk reset on restart events, which works fine for many development and testing scenarios. After a container referencing a docker image with well-known ports is running, use the ltc status -d APPNAME command to see the port mapping. See the troubleshooting docs if necessary.

SSH functionality in the below examples is available as of v0.4.2.

Redis

ltc create redis redis --timeout=5m --memory-mb=256 --tcp-route=6379 --monitor-command="redis-cli --scan"
redis-cli -h 192.168.11.11

RabbitMQ

ltc create rabbit rabbitmq --tcp-route 5672:5672 --monitor-port 5672
w/ Management Console
ltc create rabbit rabbitmq:management --http-route rabbit-mgmt:15672 --tcp-route 5672:5672 --monitor-port 5672

MySQL

In 3 separate terminals,

ltc create mysql mysql --memory-mb 512 --env MYSQL_ROOT_PASSWORD=somesecret --tcp-route 3306:3306
mysql -h"192.168.11.11" -p"somesecret" -u"root"
ltc ssh mysql

Postgres

In 3 separate terminals,

ltc create postgres postgres --privileged --monitor-command="PGPASSWORD=somesecret psql -U postgres -l" --env POSTGRES_PASSWORD=somesecret --tcp-route=5432
PGPASSWORD=somesecret psql -U postgres -h 192.168.11.11
ltc ssh postgres -- psql -U postgres

Mongo

ltc create mongo mongo --user=root --memory-mb 256 --env LC_ALL=C --ports 27017 --tcp-route 27017:27017 -- /entrypoint.sh --smallfiles
mongo 192.168.11.11:27017
w/ REST interface
ltc create mongo mongo --user=root --memory-mb 256 --env LC_ALL=C --ports 27017,28017 --http-route mongo-rest:28017 --tcp-route 27017:27017 --monitor-port 27017 -- /entrypoint.sh --smallfiles --rest --httpinterface

Neo4J

ltc create neo4j tpires/neo4j --memory-mb 512 --http-route neo4j-web:7474 --tcp-route 1337:1337
ltc ssh neo4j neo4j-shell

It may take some time for this container to load the first time. It will continue to start if ltc create times out. The app status can be monitored with ltc status neo4j -r 1s.

Ubuntu

ltc create ubuntu ubuntu --no-monitor
ltc ssh ubuntu

Nginx

ltc create nginx nginx --ports 80 --http-route nginx:80 --monitor-url 80:/
curl -I http://nginx.local.lattice.cf

Spring Cloud Config Server

ltc create configserver springcloud/configserver --memory-mb 1024

If you want to register with Eureka add an env var:

ltc create configserver springcloud/configserver --memory-mb 1024 --env EUREKA_SERVICE_URL=http://eureka.local.lattice.cf

Spring Cloud Eureka Server

ltc create eureka springcloud/eureka --memory-mb 1024

Spring Cloud Clients

ltc create myapp mygroup/myapp --env CONFIG_SERVER_URL=http://configserver.local.lattice.cf --env EUREKA_SERVICE_URL=http://eureka.local.lattice.cf

Modular. Flexible. Powerful

Application Instances