Dockerfile instructions
- Refer Here
- Instructions
INSTRUCTION ARGS
## Examples
FROM openjdk:8
RUN apt-get update
-
CMD and ENTRYPOINT:
- These command execute when container is creating
- CMD can be overritten
- ENTRYPOINT cannot be overritten
-
How to get inside docker container
- It is called as interactive mode
- In two scenarios
- While creating container
docker container run -it image:tag <shellterminal>
- docker container run -it alpine
- docker container run -it ubuntu /bin/bash
- To exit and stop the container execute command exit
- TO exit and keep your container to be in running status Ctrl+p+q
- while container is running
- docker container exec -it <containerid>
- While creating container
Docker Container Lifecycle
Refer here the below image from scmgalaxy for better understanding
Excercise
- Manual Steps for gameoflife
- Install java
- Install tomcat
- Copy file from https://qt-s3-new-testing.s3-us-west-2.amazonaws.com/gameoflife.war to tomcat webapps folder
- url would be <ip>:<portexposed>/gameoflife