# \--base-url argument does not work in Docker

**URL:** <https://zola.discourse.group/t/base-url-argument-does-not-work-in-docker/2508>\
**Category:** Support\
**Created:** [March 10, 2025, 3:05am UTC](https://zola.discourse.group/t/base-url-argument-does-not-work-in-docker/2508 "2025-03-10T03:05:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattjmoran](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/mattjmoran/32/1420_2.png) [@mattjmoran](https://zola.discourse.group/u/mattjmoran)\
**Post date:** [March 10, 2025, 3:05am UTC](https://zola.discourse.group/t/base-url-argument-does-not-work-in-docker/2508/1 "2025-03-10T03:05:54Z")

</div>

I have the following `Dockerfile` and `compose.yaml` to build and serve my Zola website:

```Dockerfile
# Stage 1: Build the site with Zola
FROM ghcr.io/getzola/zola:v0.20.0 AS build
ARG BASE_URL="https://wha.sh"
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

```

```yaml
name: wha.sh
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`.

I’ve tried every combination of `ARG` and `ENV` in both the`Dockerfile` 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.

---

<div class="post-metadata">

**Author:** ![adrianboston](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/adrianboston/32/907_2.png) [@adrianboston](https://zola.discourse.group/u/adrianboston)\
**Post date:** [March 12, 2025, 11:36pm UTC](https://zola.discourse.group/t/base-url-argument-does-not-work-in-docker/2508/2 "2025-03-12T23:36:49Z")

</div>

i tried `zola --base-url http://localhost:8000 build`

and just got `error: unexpected argument '--base-url' found`

however im on `zola 0.17.2` and that paricular arg might be valid in other versions.

you can hardcode (or even pipe) that `base-url` into `config.toml`

its possible to use a difference config file using `zola --config config-prod.toml` which could contain that static web server as `base-url.`
