Z
Z
zlodiak2019-06-14 15:36:26
linux
zlodiak, 2019-06-14 15:36:26

Why can't docker open a terminal?

I downloaded the ubuntu image from dockerhub, created the following dockerfile:

FROM ubuntu
RUN apt-get -y update && apt-get install -y htop
CMD /usr/bin/htop | htop

Then I built a new image:
Step 3/3 : CMD /usr/bin/htop | htop
 ---> Running in 5618ec4eca8c
Removing intermediate container 5618ec4eca8c
 ---> a7b5990d5c94
Successfully built a7b5990d5c94
Successfully tagged ubuntu-htop:latest

And I try to run it:
[email protected] ~/docker/mydockerbuild $ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu-htop         latest              a7b5990d5c94        45 seconds ago      97.4MB
golang              latest              9fe4cdc1f173        45 hours ago        774MB
ubuntu              latest              7698f282e524        4 weeks ago         69.9MB
hello-world         latest              fce289e99eb9        5 months ago        1.84kB
[email protected] ~/docker/mydockerbuild $ docker run ubuntu-htop
Error opening terminal: unknown.
Error opening terminal: unknown.

But, as you can see, I get an incomprehensible error message. please help me to run the image.
I tried this and this , but it didn't help.
My OS is linux mint 18

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2019-06-14
@zlodiak


FROM ubuntu
RUN apt-get -y update && apt-get install -y htop
CMD ["/bin/sh", "-c", "export TERM=xterm && /usr/bin/htop"]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question