Docker Commands:Interview Question
Pre-Requisite:
HOW TO INSTALL DOCKER IN WINDOWS AND MAC
Though we all must know about Docker, but let’s revise a brief introduction about Docker:
Docker Introduction:
- Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. - The service has both free and premium tiers. - The software that hosts the containers is called Docker Engine.
Docker Image
HOW TO INSTALL DOCKER IN WINDOWS AND MAC
Create your first image using Java
Create a simple Java application
Note | If you are running OpenJDK 9,
because support for Java 5 was dropped in JDK9. You can add <properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties> to the generated |
Create a new Java project:
mvn archetype:generate -DgroupId=org.examples.java -DartifactId=helloworld -DinteractiveMode=false
Build the project:
cd helloworld
mvn package
Run the Java class:
java -cp target/helloworld-1.0-SNAPSHOT.jar org.examples.java.App
This shows the output:
Hello World!
Let’s package this application as a Docker image.
Java Docker image
Run the OpenJDK container in an interactive manner:
docker container run -it openjdk
This will open a terminal in the container. Check the version of Java:
root@8d0af9da5258:/# java -version
openjdk version "1.8.0_141"
OpenJDK Runtime Environment (build 1.8.0_141-8u141-b15-1~deb9u1-b15)
OpenJDK 64-Bit Server VM (build 25.141-b15, mixed mode)
A different JDK version may be shown in your case.
Exit out of the container by typing exit
in the container shell.
Docker image repositories
Docker images get stored in private or public repositories, such as those in the Docker Hub cloud registry service, from which users can deploy containers and test and share images. Docker Hub's Docker Trusted Registry also provides image management and access control capabilities.
Top API Interview Question 1-10
Top API INterview Questions 11-20
Top API AUTOMATION Interview Q&A - 21-30Learn (API-Microservice)Testing+(CoreJava+UI)-SDET with Self Paced Videos and one LIVE Doubt Session
Entire course content can be found below: COURSE CONTENT*************************************************
SeleniumWebdriver Automation Testing Interview Questions:API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign
Java Related Interview Question Set
https://automationreinvented.blogspot.com/search/label/Java
GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT
Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions
Mobile Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Mobile%20Testing
Python Interview Question Set for QAE - SDET - SDE:
https://automationreinvented.blogspot.com/search/label/Python
No comments:
Post a Comment