Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
FROM openjdk:11-jre-slim
RUN apt update \
  # procps is for `free` command
  && apt install wget unzip lsof procps -y \
  #&& wget https://www-us.apache.org/dist/incubator/iotdb/0.9.1-incubating/apache-iotdb-0.9.1-incubating-bin.zip \
  && wget http://mirrors.tuna.tsinghua.edu.cn/apache/incubator/iotdb/0.9.1-incubating/apache-iotdb-0.9.1-incubating-bin.zip \
  && unzip apache-iotdb-0.9.1-incubating-bin.zip \
  && rm apache-iotdb-0.9.1-incubating-bin.zip \
  && mv apache-iotdb-0.9.1-incubating /iotdb \
  && apt remove wget unzip -y \
  && apt autoremove -y \
  && apt purge --auto-remove -y \
  && apt clean -y
EXPOSE 6667
EXPOSE 31999
EXPOSE 5555
EXPOSE 8181
VOLUME /iotdb/data
VOLUME /iotdb/logs
ENV PATH="/iotdb/sbin/:/iotdb/tools/:${PATH}"
ENTRYPOINT ["/iotdb/sbin/start-server.sh"]


Dockerfile-0.12.4-node的示例

No Format
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

FROM openjdk:11-jre-slim
RUN apt update \
  # procps is for `free` command
  && apt install wget unzip lsof procps -y \
  && wget https://downloads.apache.org/iotdb/0.12.4/apache-iotdb-0.12.4-server-bin.zip \
  # if you are in China, use the following URL
  #&& wget https://mirrors.tuna.tsinghua.edu.cn/apache/iotdb/0.12.4/apache-iotdb-0.12.4-server-bin.zip \
  && unzip apache-iotdb-0.12.4-server-bin.zip \
  && rm apache-iotdb-0.12.4-server-bin.zip \
  && mv apache-iotdb-0.12.4-server-bin /iotdb \
  && apt remove wget unzip -y \
  && apt autoremove -y \
  && apt purge --auto-remove -y \
  && apt clean -y
# rpc port
EXPOSE 6667
# JMX port
EXPOSE 31999
# sync port
EXPOSE 5555
# monitor port
EXPOSE 8181
VOLUME /iotdb/data
VOLUME /iotdb/logs
ENV PATH="/iotdb/sbin/:/iotdb/tools/:${PATH}"
ENTRYPOINT ["/iotdb/sbin/start-server.sh"]


Dockerfile-0.12.4-cluster的示例

No Format
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

FROM openjdk:11-jre-slim
RUN apt update \
  # procps is for `free` command
  && apt install wget unzip lsof procps -y \
  && wget https://downloads.apache.org/iotdb/0.12.4/apache-iotdb-0.12.4-cluster-bin.zip \
  # if you are in China, use the following URL
  #&& wget https://mirrors.tuna.tsinghua.edu.cn/apache/iotdb/0.12.4/apache-iotdb-0.12.4-cluster-bin.zip \
  && unzip apache-iotdb-0.12.4-cluster-bin.zip \
  && rm apache-iotdb-0.12.4-cluster-bin.zip \
  && mv apache-iotdb-0.12.4-cluster-bin /iotdb \
  && apt remove wget unzip -y \
  && apt autoremove -y \
  && apt purge --auto-remove -y \
  && apt clean -y \
  # modify the seeds in configuration file
  && sed -i '/^seed_nodes/cseed_nodes=127.0.0.1:9003' /iotdb/conf/iotdb-cluster.properties \
  && sed -i '/^default_replica_num/cdefault_replica_num=1' /iotdb/conf/iotdb-cluster.properties

# rpc port
EXPOSE 6667
# JMX port
EXPOSE 31999
# sync port
EXPOSE 5555
# monitor port
EXPOSE 8181
# internal meta port
EXPOSE 9003
# internal data port
EXPOSE 40010
VOLUME /iotdb/data
VOLUME /iotdb/logs
ENV PATH="/iotdb/sbin/:/iotdb/tools/:${PATH}"
ENTRYPOINT ["/iotdb/sbin/start-node.sh"]

Dockerfile-0.12.4-grafana的示例

No Format
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

FROM openjdk:11-jre-slim
RUN apt update \
  # procps is for `free` command
  && apt install wget unzip lsof procps -y \
  && wget https://downloads.apache.org/iotdb/0.12.4/apache-iotdb-0.12.4-grafana-bin.zip \
  # if you are in China, use the following URL
  #&& wget https://mirrors.tuna.tsinghua.edu.cn/apache/iotdb/0.12.4/apache-iotdb-0.12.4-grafana-bin.zip \
  && unzip apache-iotdb-0.12.4-grafana-bin.zip \
  && rm apache-iotdb-0.12.4-grafana-bin.zip \
  && mv apache-iotdb-0.12.4-grafana-bin /iotdb-grafana \
  && apt remove wget unzip -y \
  && apt autoremove -y \
  && apt purge --auto-remove -y \
  && apt clean -y
# rpc port
EXPOSE 8888
VOLUME /iotdb-grafana/config
RUN echo "#!/bin/bash" > /iotdb-grafana/runboot.sh
RUN echo "java -Djava.security.egd=file:/dev/./urandom -jar /iotdb-grafana/iotdb-grafana.war" >> /iotdb-grafana/runboot.sh
RUN chmod a+x /iotdb-grafana/runboot.sh
WORKDIR /iotdb-grafana
ENTRYPOINT ["./runboot.sh"]


注意该脚本可以存储到docker/src/main下。

...

docker build -t apache/iotdb:0.9.1 .

0.12.X版本可以用下面的命令

docker build -t apache/iotdb:0.12.4 . -f Dockerfile-0.12.4-node


然后本地尝试运行:

docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 apache/iotdb:0.9.1

...