12. Docker
“Docker containers wrap up a piece of software in a complete filesystem that
contains everything it needs to run: code, runtime, system tools, system libraries –
anything you can install on a server. This guarantees that it will always run the
same, regardless of the environment it is running in.” - Docker docs
What is it?
13. Docker How it works?
● Docker Hub
● Images
● Build Images
● Share host resources
15. Docker How run docker commands
docker run <image> command
16. Docker and Ruby
● Create a ruby file (hello.rb), with this:
● Run it with docker
docker run --rm -v "$(pwd)":/app -w /app ruby:2.2
'ruby hello.rb'
puts ‘The Power of Docker’
17. and Node
● Create a node file (hello.js), with this:
● Run it with docker
Docker
docker run --rm -v "$(pwd)":/app -w /app node
'node hello.js'
console.log(‘Node works too’);
18. ● To link the app we need to start postgres and give it a name
● Then, start the app linking it to postgres
Docker
docker run -d --name db -e
POSTGRES_PASSWORD=123456 postgres
docker run -d -P --link db:dbLink image command
and PostgreSql