2. Problems with deploying
- Need to install Software, Tool, etc
- Different Operating System
- Code Architecture
- etc
“My code works on my machine”
3. What does Docker do anyway?
- Tool for running an application in an isolated environment
- Ensures that it always run in the same environment
- If you say it works on your PC then it will work in all machines!
- Makes collaboration between teams easier
- Quickly scale your application
- Sandboxes your application
5. How does Docker differ anyway?
- Wraps a piece of software in a complete filesystem that contains
everything needed to run. ( code, libraries, system tools, dependencies, etc)
- Creates a CONTAINER
7. Containers and Images
- Image
- Template for your created application with the environment you want
- Container
- Running Instance of an Image
8. How to create images
- By creating a Dockerfile
- Dockerfile
- Textfile with instructions to setup your application
https://docker.github.io/engine/reference/builder/
9. Inside the Dockerfile
INSTRUCTION arguments #FORMAT
Some Instructions:
FROM baseimage
RUN command
COPY source destinationInDocker
ENV variableName value
EXPOSE portNumber
ENTRYPOINT [“command”, “arg1”, “arg2”, ...]
10. Docker commands
docker build -t imagename locationOfDockerfile #build the image
docker images #list images
docker ps #list containers
docker run imagename #create & run a container
docker run -e var=val
-p hostPort:exposedPort
-d
--name nameOfContainer
imagename