Skip to content

Instantly share code, notes, and snippets.

@fthamura
Last active October 10, 2015 14:47
Show Gist options
  • Save fthamura/2e476189d12ca08cc0d8 to your computer and use it in GitHub Desktop.
Save fthamura/2e476189d12ca08cc0d8 to your computer and use it in GitHub Desktop.
Docker Java Steps from Arun Gupta's
Full tutorial: https://htmlpreview.github.io/?https://github.com/javaee-samples/docker-java/blob/master/readme.html
etc/hosts
192.168.99.100 dockerhost
docker run swarm create
mervo@sharkbay:~$ docker-machine create -d virtualbox --swarm --swarm-master --swarm-discovery token://[from swarm create] swarm-master
docker-machine start lab
eval "$(docker-machine env lab)"
docker run -it -p 8080:8080 jboss/wildfly
http://dockerhost:8080/
docker run -P -d arungupta/wildfly-management
u: admin
p: docker#admin
-- stop
docker stop $(docker ps -q)
docker ps -a -f "exited=-1"
-- remove wildfly container
docker ps -a | grep wildfly | awk '{print $1}' | xargs docker rm
-- remove all containers
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
docker run -it -p 8080:8080 arungupta/javaee7-hol
http://dockerhost:8080/movieplex7/
docker run -d -p 80:8080 -p 443:8443 jetty
-- Linking Container DB + App
docker run --name mysqldb -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_DATABASE=sample -e MYSQL_ROOT_PASSWORD=supersecret -p 3306:3306 -d mysql
docker run -it --name mywildfly --link mysqldb:db -p 8080:8080 arungupta/wildfly-mysql-javaee7
git clone https://github.com/javaee-samples/javaee7-simple-sample.git
mvn clean package
docker run --name wildfly -d -p 8080:8080 -v [folder javaee7-simple-sample]/target:/opt/jboss/wildfly/standalone/deployments/:rw jboss/wildfly
-- see the log
docker logs -f wildfly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment