我正在尝试使用此dockerfile构建一个运行elasticsearch v2的docker容器(我使用的是RHEL 6和docker 1.7.1):
FROM partlab/ubuntu-java
MAINTAINER Régis Gaidot <regis@partlab.co>
ENV DEBIAN_FRONTEND noninteractive
ENV INITRD No
ENV LANG en_US.UTF-8
ENV PATH=$PATH:/usr/share/elasticsearch/bin
RUN wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add - && \
echo 'deb http://packages.elasticsearch.org/elasticsearch/2.x/debian stable main' \
| tee /etc/apt/sources.list.d/elasticsearch.list && \
apt-get update && \
apt-get install --no-install-recommends -y elasticsearch && \
/usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /usr/share/elasticsearch
RUN set -ex \
&& for path in \
./data \
./logs \
./config \
./config/scripts \
; do \
mkdir -p "$path"; \
chown -R elasticsearch:elasticsearch "$path"; \
done
COPY ./config /usr/share/elasticsearch/config
USER elasticsearch
VOLUME ["/usr/share/elasticsearch"]
EXPOSE 9200 9300
CMD ["elasticsearch"]
我还使用以下方式拉出了预建的图像:
docker pull partlab/ubuntu-elasticsearch
但不幸的是,每当我使用以下docker run命令时,容器都会退出:
docker run -d -p 9200:9200 -p 9300:9300 --net=bridge --name elastic_container -v /home/my_project/elastic_data
partlab / Ubuntu的elasticsearch
或者这个:
docker run -d -p 9200:9200 -p 9300:9300 --net=bridge --name elastic_container partlab/ubuntu-elasticsearch
以下是泊坞日志的结果:
[2017-08-28 10:54:16,087][WARN ][bootstrap ] unable to install syscall filter: seccomp unavailable: CONFIG_SECCOMP no
t compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data/elasticsearc
h)
Likely root cause: java.nio.file.FileSystemException: /usr/share/elasticsearch/data/elasticsearch: No space left on device
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
at java.nio.file.Files.createDirectory(Files.java:674)
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
at java.nio.file.Files.createDirectories(Files.java:767)
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:337)
at org.elasticsearch.bootstrap.Security.addPath(Security.java:314)
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:259)
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:212)
at org.elasticsearch.bootstrap.Security.configure(Security.java:118)
at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:196)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
当我使用docker 17.6在我的Mac上构建相同的图像时,它可以完美地工作。
在我的系统会话中使用df -h
的存储空间:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_lptdlp01-lv_root
99G 96G 0 100% /
tmpfs 32G 1.2M 32G 1% /dev/shm
/dev/sda1 477M 67M 385M 15% /boot
/dev/mapper/vg_lptdlp01-lv_home
886G 105G 737G 13% /home
cm_processes 32G 38M 32G 1% /var/run/cloudera-scm-agent/process
在ubuntu容器中使用df -h
的存储空间:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/docker-253:0-967159-ac79433eebd0c389290f.... 9.8G 7.7G 1.6G 84% /
tmpfs 32G 0 32G 0% /dev
shm 64M 0 64M 0% /dev/shm
/dev/mapper/vg_lptdlp01-lv_root 99G 96G 0 100% /etc/hosts