Created
April 29, 2015 09:53
-
-
Save jmbataller/715f0731b8958ede35e8 to your computer and use it in GitHub Desktop.
Docker commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Docker in MAC | |
https://docs.docker.com/installation/mac/ | |
Create an image | |
sudo docker build -t eif_accounts . | |
Run image | |
docker run eif_accounts | |
docker run --name accounts-service --link mysql-accounts:mysql --link activemq:activemq -d -p 8080:8080 eif_accounts | |
--------------------------------------------------- | |
MySQL | |
Download: | |
docker pull mysql:5.6.24 | |
Run: (with -P, maps the container to host port) | |
docker run -p 3306:3306 --name mysql-accounts -e MYSQL_ROOT_PASSWORD=admin -e MYSQL_USER=admin -e MYSQL_PASSWORD=admin -e MYSQL_DATABASE=accounts -d mysql:5.6.24 | |
See MySQL logs: | |
docker logs mysql-accounts | |
--------------------------------------------------- | |
ActiveMQ | |
Download: | |
docker pull kdomanski/activemq:5.10.0 | |
Run: | |
docker run --name='activemq' -p 8161:8161 -d kdomanski/activemq:5.10.0 | |
--------------------------------------------------- | |
SSH a container: | |
docker exec -it accounts-service /bin/bash | |
To check links / dependencies between containers: | |
cat /etc/hosts | |
My local docker virtual machine: | |
192.168.59.103 | |
---------------------- | |
http://www.fig.sh/ | |
Investigate Fig and Docker compose | |
Remove temporary build images: | |
docker images -notrunc| grep none | awk '{print $3}' | xargs -r docker rmi | |
---------------------- | |
Tag a container | |
sudo docker tag c936c93f0dc9 eurostardigital/eif-accounts:1.0 | |
sudo docker push eurostardigital/eif-accounts:1.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment