Most Used Docker Commands:Interview Question
Pre-Requisite:
Docker and IntelliJ IDEA
This chapter will show you basic Docker tooling with IntelliJ IDEA:
Pull Docker images
Run, stop, or delete a Container
Build an Image
Install Docker Plugin in IDEA
Go to “Preferences”, “Plugins”, “Install JetBrains plugin…”, search on “docker” and click on “Install”
Restart IntelliJ IDEA to active plugin.
Click on “Create New Project”, select “Java”, “Web Application”
Click on “Next”, give the project a name “dockercon”, click on “Finish”. This will open up the project in IntelliJ window.
Go to “Preferences”, “Clouds”, add a new deployment by clicking on “+”. Click on “Import credentials from Docker Machine”, “Detect”, and see a successful connection. You may need to check the IP address of your Docker Machine. Find the IP address of your Docker Machine as docker-machine ip <machine-name>
and specify the correct IP address here.
Go to “View”, “Tool Windows”, “Docker Tooling Window”. Click on “Connect”" to connect with Docker Machine. Make sure Docker Machine is running.
Warning | IDEA does not work with “Docker for Mac” at this time. (ADD BUG #) |
************************
Pull an Image
Select top-level node with the name “Docker”, click on “Pull image”
Type an image name, such as arungupta/couchbase
, and “OK”
Expand “Containers” and “Images” to see existing running containers and images.
The specified image is now downloaded and shown as well.
Run a Container
Select the downloaded image, click on “Create container”
Select “After launch” and enter the URL as http://192.168.99.100:8091
. Make sure to match the IP address of your Docker Machine.
In “Container” tab, add “Port bindings” for 8091:8091
Click on “Run” to run the container.
This will bring up the browser window and display the page http://192.168.99.100:8091 and looks like:
This image uses Couchbase REST API to configure the Couchbase server.
Right-click on the running container, select “Inspect” to see more details about the container.
Click on “Stop container” to stop the container and “Delete container” to delete the container.
Build an Image
Refer to the instructions https://www.jetbrains.com/help/idea/2016.1/docker.html
Right-click on the project, create a new directory
docker-dir
Artifact
Click on top-right for “Project Structure”
select “Artifacts”
change “Type:” to “Web Application: Archive”
change the name to
dockercon
change
Output directory
todocker-dir
Create “Dockerfile” in this directory. Use the contents
FROM jboss/wildfly ADD dockercon.war /opt/jboss/wildfly/standalone/deployments/
“Run”, “Edit Configurations”, add new “Docker Deployment”
“Deployment” tab
Change the name to
dockercon
Select “After launch”, change the URL to “http://192.168.99.100:18080/dockercon/index.jsp”;
In “Before launch”, add “Build Artifacts” and select the artifact
“Container” tab
Add “Port bindings” for “8080:18080”
View, Tool Windows, Docker, connect to it
Run the project
Special credit to arun gupta*
Learn (API-Microservice)Testing+(CoreJava+UI)-SDET with Self Paced Videos and one LIVE Doubt Session
Interview questions for SDET/Automation Testing: Top 21 GIT interview questions Top 30 Selenium Webdriver Interview Q&A Top 20 API Testing Interview Q&ASelenium Interview Question SET-4 Selenium Interview Question SET-1 Selenium Interview Question SET-2 Selenium Interview Questions SET-3 Selenium Interview Question SET-4
Check GIT commands for Interview preparation SET-1:GIT Interview Question 1 to 11
Check GIT commands for Interview preparation SET-2:
GIT Interview Question 12 to 21
Check GIT commands for Interview preparation SET-3:
GIT Interview Question 21 to 30
*************************************************
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