简体   繁体   English

尝试在Docker中运行Cloudera Image

[英]Trying to run Cloudera Image in Docker

I am trying to run cloudera/clusterdock in a docker image for a university project. 我正在尝试在大学项目的docker映像中运行cloudera / clusterdock。 This is my first time using docker and so far I have been using the instructions on the cloudera website which are a little sparse. 这是我第一次使用docker,到目前为止,我一直在使用cloudera网站上的说明,该说明有点稀疏。

I successfully downloaded docker and the cloudera image and when I run the docker-images command I get the following: 我成功下载了docker和cloudera映像,当我运行docker docker-images命令时,得到以下信息:

REPOSITORY             TAG                 IMAGE ID            CREATED             SIZE
cloudera/clusterdock   latest              9b4d4f1dda22        7 days ago          467.5 MB

When I try and run up the container with this image. 当我尝试使用此图像运行容器时。 Using the following command 使用以下命令

docker run cloudera/clusterdock:latest /bin/bash

I get the following message 我收到以下消息

    File "/bin/bash", line 1
    SyntaxError: Non-ASCII character '\x80' in file /bin/bash on line 2,
 but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Having read the pep mentioned pep I know I need to change the encoding in a file but the pep concentrates on python files and I am unaware of having a python file so have no idea where to find it to correct it. 阅读了pep提到的pep之后,我知道我需要更改文件中的编码,但是pep专注于python文件,并且我不知道有python文件,因此不知道在哪里可以找到它来进行更正。 Also, having limited knowledge I am uneasy changing the bin/bash file as I know it can affect your machine. 另外,由于知识有限,我不方便更改bin / bash文件,因为我知道它会影响您的计算机。

Any help will have to assume I have little knowledge of this as I have little experience. 任何帮助都必须假设我对这方面的知识很少,因为我经验不足。

If you look at Dockerfile for cloudera/clusterdock:latest , you can see: 如果你看一下Dockerfilecloudera/clusterdock:latest ,你可以看到:

ENTRYPOINT ["python"]

So, when you do docker run cloudera/clusterdock:latest /bin/bash , you are basically doing python /bin/bash inside the container. 因此,当您docker run cloudera/clusterdock:latest /bin/bash ,您基本上是在容器内执行python /bin/bash You will see the same error if you type that in your terminal, normally: 如果在终端中键入错误,通常会出现以下错误:

$ python /bin/bash
  File "/bin/bash", line 1
SyntaxError: Non-ASCII character '\xe0' in file /bin/bash on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

You probably wanted to do: 您可能想做:

docker run -it --entrypoint=/bin/bash cloudera/clusterdock:latest

Look at clusterdock.sh to see how actually the container is supposed to be run. 查看clusterdock.sh以查看应该如何实际运行容器。

The associated docs (eg the description on the image's Docker Hub page or our blog post) describe that clusterdock is intended to be run by sourcing clusterdock.sh. 相关文档(例如,映像的Docker Hub页面或我们的博客文章上的描述)描述了clusterdock旨在通过寻找clusterdock.sh来运行。 This is required because the framework controls Docker on the host machine. 这是必需的,因为框架控制主机上的Docker。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM