admin管理员组文章数量:1404595
I have the following Dockerfile
and compose.yaml
to build and serve my Zola website:
# Stage 1: Build the site with Zola
FROM ghcr.io/getzola/zola:v0.20.0 AS build
ARG BASE_URL=";
COPY . /project
WORKDIR /project
RUN ["zola", "build", "--base-url", "$BASE_URL"]
# Stage 2: Serve the site with Static Web Server
FROM ghcr.io/static-web-server/static-web-server:2 AS server
WORKDIR /
COPY --from=build /project/public /public
services:
zola:
build:
context: .
target: server
args:
BASE_URL: "http://localhost:8000"
develop:
watch:
- path: .
action: rebuild
ports:
- "8000:80"
When I build with docker compose build --no-cache
I see in the log statements:
=> [zola build 4/4] RUN ["zola", "build", "--base-url", "http://localhost:8000"] 0.1s
This shows that the ARG
was read from compose.yaml
and used when executing zola build
.
However when I go to http://localhost:8000
and inspect anything that uses get_url
I see that the base url is the name of the ARG
, $BASE_URL
. For example, in my base.html
I have the following line of code:
<link rel="stylesheet" href="{{ get_url(path="base.css") }}">
When I inspect the contents of the build inside of the Docker container the href
has the value "$BASE_URL/base.css"
instead of "http://localhost:8000/base.css"
.
I've tried every combination of ARG
and ENV
in both theDockerfile
and compose.yaml
and am unable to have the --base-url
parameter work. I am starting to think it has to be an issue witht the Zola image rather than Docker, but would like to confirm I haven't made any mistakes before I create an issue for this.
本文标签: baseurl flag for Zola CLI doesn39t work in DockerStack Overflow
版权声明:本文标题:--base-url flag for Zola CLI doesn't work in Docker - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744845460a2628176.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论