DevOps Flashcards

1
Q

How do you create a docker image?

A

docker run -p localport:conatinerport {-d optional} {–name optional} imagename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to detach the running docker from terminal?

A

By adding -d

docker run -p -d localport:conatinerport {-d optional} {–name optional} imagename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you get a new image from repo in docker

A

Docker pull nameofimage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to build an image on docker

A

docker build -t{tagname} .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is docker network?

A

Docker networking enables a user to link a Docker container to as many networks as he/she requires. Docker Networks are used to provide complete isolation for Docker containers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain the steps in dockerization

A
  1. docker pull image
  2. docker run -p {p1:p2} –name name image
  3. create Dockerfile
  4. docker build -t appname .
  5. docker run -p {p1:p2} –name name -e dbhost -e dbname image // this fails
  6. docker netwoek create net-name
  7. docker network connect net-name appname
  8. docker run -p {p1:p2} –name name –net netname -e dbhost -e dbname image //shudnt fail
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to push a docker image to dokcer hub?

A
  1. give tag names for images with docker image tag sourcename tagname
  2. docker push username/taggname
How well did you know this?
1
Not at all
2
3
4
5
Perfectly