使用Elasticsearch 2.1自带的Docker容器的权限问题 [英] Permission issues with own built Docker container with Elasticsearch 2.1

查看:579
本文介绍了使用Elasticsearch 2.1自带的Docker容器的权限问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <$ c 

当我从公众弹性购物回收中抽出图像时,产生容器的图像可以正常工作。 $ c> docker pull elasticsearch

docker run -d elasticsearch

但是我使用Dockerfile生成一个容器,在那里可以使用公共回购给我权限问题。我确实有与公共回购相同的目录结构。

  myfolder / Dockerfile 

myfolder / docker- entrypoint.sh

myfolder / config / elasticsearch.yml

myfolder / config / logging.yml


https:// github .com / docker-library / elasticsearch / tree / 0d393d9a0a2e24fca022a89ad10c7050b2925292 / 2.1

命令: -
1)使用Dockerfile构建图像

  sudo docker build -t testuser / testelastic:v1。 

2)从构建图像中产生的容器

  sudo docker run -d --name elastic -v ./config:/config testuser / testelastic:v1 

但是当我尝试从上述自定义构建映像中产生任何容器时,它会给我以下错误。

 来自守护程序的错误响应:无法启动容器8e72f3c33d054f5883b2de9e7673bc032333e633e3f43905d7d22a12ea76ad04:[8]系统错误:exec:/docker-entrypoint.sh:权限被拒绝
/ pre>

解决方案

  chmod + x docker-entrypoint.sh 

您需要脚本才能执行。然后建立并运行。


When I pull an image from public elasticsearch repo, spawning container with that pulled image is working fine for me with no permission issues.

docker pull elasticsearch

docker run -d elasticsearch

But when I spawn a container with the Dockerfile which is available there with the public repo gives me permission issues. I do have a same directory structure as public repo.

myfolder/Dockerfile

myfolder/docker-entrypoint.sh

myfolder/config/elasticsearch.yml

myfolder/config/logging.yml


https://github.com/docker-library/elasticsearch/tree/0d393d9a0a2e24fca022a89ad10c7050b2925292/2.1

Commands:- 1) To build an image with the Dockerfile

sudo docker build -t testuser/testelastic:v1 .

2) Spawn container out of the built image

sudo docker run -d --name elastic -v ./config:/config testuser/testelastic:v1

But it gives me following error everytime when I tried to spawn any container out of the above custom build image.

Error response from daemon: Cannot start container 8e72f3c33d054f5883b2de9e7673bc032333e633e3f43905d7d22a12ea76ad04: [8] System error: exec: "/docker-entrypoint.sh": permission denied

解决方案

chmod +x docker-entrypoint.sh

You need the script to be executable. Then build and run.

这篇关于使用Elasticsearch 2.1自带的Docker容器的权限问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆