Docker Fundamentals Flashcards

1
Q

What are the main components of a dockerfile?

A
  1. Base image
    FROM python:3.8.3-slim-buster
  2. Copy files
    COPY . /src
  3. Install dependencies
    RUN pip install -r /src/requirements.txt
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

How do you create a new docker image?

A

Create a dockerfile or run docker init, then do docker build -t your-app-name . and then docker up -p 8080:8080 your-app-name

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

How do you stop a running docker container?

A

docker stop your-image-name

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

How do you check the currently running docker images?

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

How do you enter a docker container and start a interactive shell?

A
docker exec -it my_container /bin/bash
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly