Intern — Junior
Have you created images and containers using Docker?
sobes.tech AI
Answer from AI
Yes, I have created images and containers using Docker. The process usually looks like this:
- Write a Dockerfile — a text file with instructions on how to build an image (for example, a base image, installing dependencies, copying code, running the application).
- Use the
docker buildcommand to create an image. - The image is run in a container with the
docker runcommand.
Here's a simple example of a Dockerfile for a Python application:
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt ./
RUN pip install -r requirements.txt
COPY . ./
CMD ["python", "app.py"]
This approach allows isolating the environment and easily deploying applications on different machines.