就是一打开这个程序后的tutorial
我把这个步骤手打出来(居然没法粘贴)
# step1 clone
docker run --name repo alpine/git clone https://github.com/docker/getting-started.git
docker cp repo:/git/getting-started/ .
# step2 build
cd getting-started
docker build -t docker101tutorial .
# step3 run
docker run -d -p 80:80 --name docker-tutorail docker101tutorial
# share
docker tag docker101tutorial liaoxin/docker101tutorial
docker push liaoxin/docker101tutorial
在第二步build的时候总是报错
> [build 2/2] RUN mkdocs build:
#23 0.568 Traceback (most recent call last):
#23 0.568 File "/usr/local/bin/mkdocs", line 8, in
#23 0.568 sys.exit(cli())
#23 0.568 File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
#23 0.568 return self.main(*args, **kwargs)
#23 0.568 File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
#23 0.568 rv = self.invoke(ctx)
#23 0.568 File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
#23 0.569 return _process_result(sub_ctx.command.invoke(sub_ctx))
#23 0.569 File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
#23 0.569 return ctx.invoke(self.callback, **ctx.params)
#23 0.569 File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
#23 0.570 return __callback(*args, **kwargs)
#23 0.570 File "/usr/local/lib/python3.10/site-packages/mkdocs/__main__.py", line 187, in build_command
#23 0.570 build.build(config.load_config(**kwargs), dirty=not clean)
#23 0.570 File "/usr/local/lib/python3.10/site-packages/mkdocs/config/base.py", line 216, in load_config
#23 0.570 from mkdocs.config.defaults import get_schema
#23 0.570 File "/usr/local/lib/python3.10/site-packages/mkdocs/config/defaults.py", line 1, in
#23 0.570 from mkdocs.config import config_options
#23 0.570 File "/usr/local/lib/python3.10/site-packages/mkdocs/config/config_options.py", line 8, in
#23 0.570 from mkdocs import utils, theme, plugins
#23 0.570 File "/usr/local/lib/python3.10/site-packages/mkdocs/theme.py", line 6, in
#23 0.570 from mkdocs.utils import filters
#23 0.570 File "/usr/local/lib/python3.10/site-packages/mkdocs/utils/filters.py", line 13, in
#23 0.570 @jinja2.contextfilter
#23 0.570 AttributeError: module 'jinja2' has no attribute 'contextfilter'
------
executor failed running [/bin/sh -c mkdocs build]: exit code: 1
报这样的错误
Google:docker build error mkdocs build
在StackOverflow的一个帖子上
找到了答案,不是得票最高的那个答案,得票最高的那个答案说,是因为python的版本不对,我更改了dockerfile中的python版本,也还是报错。
答案是得票最低的那个,其实是requirements.txt,里面少写了包
加入这个之后,ok成功了。
参考
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)