从 gitlab 文档中可以看出如何使用 kaniko 创建 docker 镜像:
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
only:
- tags
Run Code Online (Sandbox Code Playgroud)
但我想先运行测试(pytest),然后再将其推送到容器注册表。任何帮助是极大的赞赏。谢谢!
您好,我正在尝试安装fastapi ,但在安装orjson时似乎失败
\n\n这是完整的错误代码:
\n\nBuilding wheel for orjson (PEP 517) ... error\n ERROR: Command errored out with exit status 1:\n command: \'d:\\pythonapps\\fastapi_tutorial\\env\\scripts\\python.exe\' \'d:\\pythonapps\\fastapi_tutorial\\env\\lib\\site-packages\\pip\\_vendor\\pep517\\_in_process.py\' build_wheel \'C:\\Users\\User\\AppData\\Local\\Temp\\tmp4yope0de\'\n cwd: C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-35a1h4do\\orjson\n Complete output (50 lines):\n Compiling cfg-if v0.1.10\n Compiling winapi v0.3.8\n Compiling bitflags v1.2.1\n Compiling ryu v1.0.5\n Compiling scopeguard v1.1.0\n Compiling packed_simd v0.3.3\n Compiling serde v1.0.111\n Compiling lexical-core v0.7.4\n Compiling libc v0.2.71\n Compiling version_check v0.9.2\n Compiling smallvec v1.4.0\n Compiling arrayvec v0.5.1\n Compiling encoding_rs v0.8.23\n Compiling static_assertions v1.1.0\n Compiling itoa v0.4.5\n …Run Code Online (Sandbox Code Playgroud) 我想知道是否可以创建一个强制中断来分割表行?我认为 weasyprint 在某种意义上做到了这一点,但我想将行分成特定的计数(例如每页 6 行)。那可能吗?我尝试过这样的事情:
<table>
<tr>
<th>Header1</th>
<th>Header2</th>
</tr>
{% for d in data %}
{% if forloop.counter == 6 %}
<p style="page-break-before: always;"></p>
{% endif %}
<tr>
<td>{{ d.name }}</td>
<td>{{ d.age }}</td>
</tr>
{% endfor %}
</table>
Run Code Online (Sandbox Code Playgroud)
但它只是打破了不同页面中的每一行。任何帮助,将不胜感激。