问题描述
我必须从DockerFile创建一个influxDB。我的DockerFile是:
FROM influxdb:1.7.6
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
run \
-e INFLUXDB_DB=db0 -e INFLUXDB_ADMIN_ENABLED=true \
-e INFLUXDB_ADMIN_USER=admin -e INFLUXDB_ADMIN_PASSWORD=supersecretpassword \
-e INFLUXDB_USER=telegraf -e INFLUXDB_USER_PASSWORD=secretpassword \
-v $PWD:/var/lib/influxdb \
influxdb /init-influxdb.sh
我看到了这个从(http://man.hubwiz.com/docset/Docker.docset/Contents/Resources/Documents/docs.docker.com/samples/library/influxdb.html)创建influxDB脚本的过程。现在,当我从DockerFile目录运行 docker build -t myinfluximage 时,我得到以下信息:
Sending build context to Docker daemon 2.048kB
Step 1/4 : FROM influxdb:1.7.6
1.7.6: Pulling from library/influxdb
6f2f362378c5: Pull complete
494c27a8a6b8: Pull complete
7596bb83081b: Pull complete
058194e87993: Pull complete
9382c8196521: Pull complete
651ab765a68f: Pull complete
c8620b54be93: Pull complete
5386872a43f3: Pull complete
Digest: sha256:af07db2e2040b27d4ae4c57b51729503802d22c1632893fe63ea054afe632ecc
Status: Downloaded newer image for influxdb:1.7.6
---> 8a4e8eda54c1
Step 2/4 : ENV TZ=America/Los_Angeles
---> Running in 0a81e476ec84
Removing intermediate container 0a81e476ec84
---> 5144c757b63f
Step 3/4 : RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
---> Running in b619435af05a
Removing intermediate container b619435af05a
---> adee5c481c4a
Step 4/4 : run -e INFLUXDB_DB=db0 -e INFLUXDB_ADMIN_ENABLED=true -e INFLUXDB_ADMIN_USER=admin -e INFLUXDB_ADMIN_PASSWORD=supersecretpassword -e INFLUXDB_USER=telegraf -e INFLUXDB_USER_PASSWORD=secretpassword -v $PWD:/var/lib/influxdb influxdb /init-influxdb.sh
---> Running in 14312c7bd5f4
/bin/sh: 0: Illegal option -
The command '/bin/sh -c -e INFLUXDB_DB=db0 -e INFLUXDB_ADMIN_ENABLED=true -e INFLUXDB_ADMIN_USER=admin -e INFLUXDB_ADMIN_PASSWORD=supersecretpassword -e INFLUXDB_USER=telegraf -e INFLUXDB_USER_PASSWORD=secretpassword -v $PWD:/var/lib/influxdb influxdb /init-influxdb.sh' returned a non-zero code: 2
为什么我在创建数据库脚本时遇到异常。可能是什么问题?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)