1

So I have a directory that just includes a Dockerfile. I want to experiment with the poetry package in python. So I do not want any python files to be inside it initially because I want to create a poetry project from scratch inside the directory. So ı went ahead and built the image called local:python3.10ubuntu for it. When I ran the container for it with the command docker run --name py3.10ubuntu local:python3.10ubuntu I can see that the docker container was not running why is that and how would I be able to run it. when I try to see the docker logs for the container it wouldnt show anything as well. Besides starting the container how would I be able to run the command shell within the container and run python files?

Directory Structure:

.
└── Dockerfile

Dockerfile contents

FROM python:3.10-slim
RUN pip install --no-cache-dir poetry
1
  • Do you have a shell script in the repo ? Then you can use entry point Commented Sep 4, 2022 at 1:54

2 Answers 2

1

ughhhh?

docker run -ti <your_image>

or if you want see more than python itself:

docker run -ti --entrypoint /bin/bash <your_image>
Sign up to request clarification or add additional context in comments.

Comments

0

Your dockerfile is not configured properly try to refer below website on how to create a docker file for poetry.

Dockerfile for poetry

Also to run a shell script in dockerfile it could be done if your code has a .sh file. You could either use RUN, ENTRYPOINT, CMD or combination of these to run the shell script in your docker file.Refer the below answer

Using ENTRYPOINT to run shell script in dockerfile

To run a docker container you can use

docker run -it <docker-image>

Try exec command to run something inside the container

docker exec -it <container-name-or-id> bash

2 Comments

what does the it parameters functionality do. @llinux_beginner gave it as -ti.
-i means interactive and -t means Allocate a pseudo-TTY when you use them together with -it and run a docker command with these flags it will take you inside the docker container . If you run a docker container using -itd commands it runs the container in the background -d stands for detach. You can get a better understanding from the documentation :docs.docker.com/engine/reference/commandline/run

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.