Skip to content

Commit 4dfbab2

Browse files
domenicfoolip
authored andcommitted
Always use the latest Wattsi with Docker
This is a better version of the fix introduced in 2f31da5.
1 parent d2dfe13 commit 4dfbab2

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
ARG WATTSI_VERSION
2-
FROM whatwg/wattsi:${WATTSI_VERSION} as wattsi-stage
3-
41
FROM debian:stable-slim
52
RUN apt-get update && \
63
apt-get install --yes --no-install-recommends ca-certificates curl git python3 python3-pip && \
74
rm -rf /var/lib/apt/lists/*
85

9-
COPY --from=wattsi-stage /whatwg/wattsi/bin/wattsi /bin/wattsi
6+
COPY --from=whatwg/wattsi:latest /whatwg/wattsi/bin/wattsi /bin/wattsi
107

118
RUN pip3 install bs-highlighter
129

build.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ set -o pipefail
77
cd "$(dirname "$0")"
88
DIR=$(pwd)
99

10-
# The latest required version of Wattsi. Update this if you change how ./build.sh invokes Wattsi.
10+
# The latest required version of Wattsi. Update this if you change how ./build.sh invokes Wattsi;
11+
# it will cause a warning if Wattsi's self-reported version is lower. Note that there's no need to
12+
# update this on every revision of Wattsi; only do so when a warning is justified.
1113
WATTSI_LATEST=108
1214

1315
# Shared state variables throughout this script
@@ -437,9 +439,16 @@ function relativePath {
437439
# Arguments: none
438440
# Output: A web server with the build output will be running inside the Docker container
439441
function doDockerBuild {
440-
DOCKER_BUILD_ARGS=( --tag whatwg-html --build-arg "WATTSI_VERSION=$WATTSI_LATEST" )
442+
# Ensure whatwg/wattsi:latest is up to date. Without this, the locally cached copy would be used,
443+
# i.e. once Wattsi was downloaded once, it would never update. Note that this is fast
444+
# (zero-transfer) if the locally cached copy is already up to date.
445+
DOCKER_PULL_ARGS=()
446+
$QUIET && DOCKER_PULL_ARGS+=( --quiet )
447+
DOCKER_PULL_ARGS+=( whatwg/wattsi:latest )
448+
docker pull "${DOCKER_PULL_ARGS[@]}"
449+
450+
DOCKER_BUILD_ARGS=( --tag whatwg-html )
441451
$QUIET && DOCKER_BUILD_ARGS+=( --quiet )
442-
443452
docker build "${DOCKER_BUILD_ARGS[@]}" .
444453

445454
DOCKER_RUN_ARGS=()

0 commit comments

Comments
 (0)