Docker: Error response from daemon: rpc error: code = 2 desc = “oci runtime error: exec format error”

∥☆過路亽.° 提交于 2019-12-02 22:44:06

Did you post your complete entrypoint.sh? The kernel tries to recognize the file type by looking at the first bytes of the executable. For scripts you need to add a so-called shebang line. You might need to add a shebang line at the very top of your entrypoint.sh, e.g.:

#!/bin/sh
/usr/bin/docker-quickstart
service hadoop-hdfs-namenode restart
hdfs dfs -mkdir -p input
hdfs dfs -put /twitter.avro /input/twitter.avro
spark-submit --class com.abhi.HelloWorld --master local[1] SparkIntegrationTestsAssembly.jar /input/twitter.avro /output

Error response from daemon: rpc error: code = 2 desc = “oci runtime error: exec format error”

In my case I got this error when trying to install docker on a 32bit ArchLinux (a raspberry pi 2). Instead I used HyperioOS and it went alot smoother and was so much faster to install. But in the end, most docker images are not compatible with 32 bit architectures and they outline this as a possible reason to get this error.

Here we run Docker on a Raspberry Pi. So the CPU architecture here is ARM rather than x86/x64 by Intel or AMD. Thus, Docker-based apps you use have to be packaged specifically for ARM architecture! Docker-based apps packaged for x86/x64 will not work and will result in an error

According to Cloudera's documentation you should start it with --hostname and --priviliged

From the docs

docker run --hostname=quickstart.cloudera --privileged=true -t -i [OPTIONS] [IMAGE] /usr/bin/docker-quickstart

Explanation for required flags and other options are in the following table:

--hostname=quickstart.cloudera    Required: pseudo-distributed configuration assumes this hostname
--privileged=true                 Required: for HBase, MySQL-backed Hive metastore, Hue, Oozie, Sentry, and Cloudera Manager, and possibly others
-t                                Required: once services are started, a Bash shell takes over and will die without this
-i                                Required: if you want to use the terminal, either immediately or attach later
-p 8888                           Recommended: maps the Hue port in the guest to another port on the host
-p [PORT]                         Optional: map any other ports (e.g. 7180 for Cloudera Manager, 80 for a guided tutorial)
-d                                Optional: runs the container in the background
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!