docker 内编译tensorflow serving时报错:No space left on device

使用docker run命令启动一个基础镜像,然后以交互模式在容器内使用bazel build tensorflow serving时,有时会报No space left on device这种错误。

ERROR: /dev/serving/tensorflow_serving/servables/tensorflow/BUILD:229:1: Linking of rule '//tensorflow_serving/servables/tensorflow:session_bundle_source_adapter_test' failed: gcc failed: error executing command /usr/bin/gcc -o bazel-out/local-fastbuild/bin/tensorflow_serving/servables/tensorflow/session_bundle_source_adapter_test -pthread '-fuse-ld=gold' -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin ... (remaining 4 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
/usr/bin/ld.gold: fatal error: bazel-out/local-fastbuild/bin/tensorflow_serving/servables/tensorflow/session_bundle_source_adapter_test: No space left on device
collect2: error: ld returned 1 exit status
INFO: Elapsed time: 462.832s, Critical Path: 72.60s


这是由于编译tensorflow serving时,会在当前用户目录下产生隐藏文件.cache文件,这文件很大约12G,而docker默认空间是10G,所以需要扩大docker,最好是30G。

如何增大docker 默认的空间:

http://www.cnblogs.com/HD/p/4807088.html

你可能感兴趣的:(Linux,tensorflow,serving)