本文共 5025 字,大约阅读时间需要 16 分钟。
工作目录:/home/erichan/docker-room/ubuntu-zookeeper
erichan@ubuntu14_04_1-pd:~/docker-room/ubuntu-zookeeper$ nano Dockerfile
# Version: 0.0.1FROM feuyeux/ubuntu-java7MAINTAINER Eric Han "feuyeux@gmail.com"RUN apt-get update && apt-get install -y wgetRUN wget http://apache.fayea.com/apache-mirror/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gzRUN tar -xzf zookeeper-3.4.6.tar.gz -C /optRUN cp /opt/zookeeper-3.4.6/conf/zoo_sample.cfg /opt/zookeeper-3.4.6/conf/zoo.cfgRUN mkdir -p /tmp/zookeeperENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64EXPOSE 2181 2888 3888WORKDIR /opt/zookeeper-3.4.6VOLUME ["/opt/zookeeper-3.4.6/conf", "/tmp/zookeeper"]ENTRYPOINT ["/opt/zookeeper-3.4.6/bin/zkServer.sh"]CMD ["start-foreground"]
erichan@ubuntu14_04_1-pd:~/docker-room/ubuntu-zookeeper$ d build -t feuyeux/zookeeper:3.4.6 .
erichan@ubuntu14_04_1-pd:~/docker-room$ d run --name zk346 -d feuyeux/zookeeper:3.4.6eab5250575338e52ef6232020deec5b8ef175caf63f1547fdc02413c4a29a5f8
erichan@ubuntu14_04_1-pd:~/docker-room$ d psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESeab525057533 feuyeux/zookeeper:3.4.6 "/opt/zookeeper-3.4. 5 seconds ago Up 4 seconds 3888/tcp, 2181/tcp, 22/tcp, 2888/tcp zk346
erichan@ubuntu14_04_1-pd:~/docker-room$ d logs zk346JMX enabled by defaultUsing config: /opt/zookeeper-3.4.6/bin/../conf/zoo.cfg2014-08-24 11:52:30,063 [myid:] - INFO [main:QuorumPeerConfig@103] - Reading configuration from: /opt/zookeeper-3.4.6/bin/../conf/zoo.cfg2014-08-24 11:52:30,067 [myid:] - INFO [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 32014-08-24 11:52:30,067 [myid:] - INFO [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 02014-08-24 11:52:30,067 [myid:] - INFO [main:DatadirCleanupManager@101] - Purge task is not scheduled.2014-08-24 11:52:30,067 [myid:] - WARN [main:QuorumPeerMain@113] - Either no config or no quorum defined in config, running in standalone mode2014-08-24 11:52:30,082 [myid:] - INFO [main:QuorumPeerConfig@103] - Reading configuration from: /opt/zookeeper-3.4.6/bin/../conf/zoo.cfg2014-08-24 11:52:30,083 [myid:] - INFO [main:ZooKeeperServerMain@95] - Starting server2014-08-24 11:52:30,088 [myid:] - INFO [main:Environment@100] - Server environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT2014-08-24 11:52:30,088 [myid:] - INFO [main:Environment@100] - Server environment:host.name=eab5250575332014-08-24 11:52:30,089 [myid:] - INFO [main:Environment@100] - Server environment:java.version=1.7.0_552014-08-24 11:52:30,089 [myid:] - INFO [main:Environment@100] - Server environment:java.vendor=Oracle Corporation2014-08-24 11:52:30,089 [myid:] - INFO [main:Environment@100] - Server environment:java.home=/usr/lib/jvm/java-7-openjdk-amd64/jre2014-08-24 11:52:30,089 [myid:] - INFO [main:Environment@100] - Server environment:java.class.path=/opt/zookeeper-3.4.6/bin/../build/classes:/opt/zookeeper-3.4.6/bin/../build/lib/*.jar:/opt/zookeeper-3.4.6/bin/../lib/slf4j-log4j12-1.6.1.jar:/opt/zookeeper-3.4.6/bin/../lib/slf4j-api-1.6.1.jar:/opt/zookeeper-3.4.6/bin/../lib/netty-3.7.0.Final.jar:/opt/zookeeper-3.4.6/bin/../lib/log4j-1.2.16.jar:/opt/zookeeper-3.4.6/bin/../lib/jline-0.9.94.jar:/opt/zookeeper-3.4.6/bin/../zookeeper-3.4.6.jar:/opt/zookeeper-3.4.6/bin/../src/java/lib/*.jar:/opt/zookeeper-3.4.6/bin/../conf:2014-08-24 11:52:30,089 [myid:] - INFO [main:Environment@100] - Server environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib2014-08-24 11:52:30,089 [myid:] - INFO [main:Environment@100] - Server environment:java.io.tmpdir=/tmp2014-08-24 11:52:30,089 [myid:] - INFO [main:Environment@100] - Server environment:java.compiler=2014-08-24 11:52:30,091 [myid:] - INFO [main:Environment@100] - Server environment:os.name=Linux2014-08-24 11:52:30,091 [myid:] - INFO [main:Environment@100] - Server environment:os.arch=amd642014-08-24 11:52:30,091 [myid:] - INFO [main:Environment@100] - Server environment:os.version=3.13.0-34-generic2014-08-24 11:52:30,091 [myid:] - INFO [main:Environment@100] - Server environment:user.name=root2014-08-24 11:52:30,091 [myid:] - INFO [main:Environment@100] - Server environment:user.home=/root2014-08-24 11:52:30,092 [myid:] - INFO [main:Environment@100] - Server environment:user.dir=/opt/zookeeper-3.4.62014-08-24 11:52:30,096 [myid:] - INFO [main:ZooKeeperServer@755] - tickTime set to 20002014-08-24 11:52:30,096 [myid:] - INFO [main:ZooKeeperServer@764] - minSessionTimeout set to -12014-08-24 11:52:30,096 [myid:] - INFO [main:ZooKeeperServer@773] - maxSessionTimeout set to -12014-08-24 11:52:30,114 [myid:] - INFO [main:NIOServerCnxnFactory@94] - binding to port 0.0.0.0/0.0.0.0:2181erichan@ubuntu14_04_1-pd:~/docker-room$
参考:
作者:
转载地址:http://gtkja.baihongyu.com/