Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions autobahn/docker/autobahn/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# Based on https://github.com/crossbario/autobahn-testsuite/blob/09cfbf74b0c8e335c6fc7df88e5c88349ca66879/docker/Dockerfile

FROM pypy:2-slim

# make "pypy" available as "python"
RUN ln -s /usr/local/bin/pypy /usr/local/bin/python

# We need this to fix pip & cryptography
RUN apt-get update && apt-get install -y build-essential libssl-dev

# install Autobahn|Testsuite
RUN pip install -U pip typing && \
pip install autobahntestsuite=='0.8.2'
# Use the upstream Autobahn|Testsuite image, pinned by version so that CI runs
# are reproducible; bump it deliberately.
FROM crossbario/autobahn-testsuite:25.10.1

VOLUME /config
VOLUME /report
Expand Down
6 changes: 5 additions & 1 deletion autobahn/docker/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
FROM golang:1.20.2-alpine3.17
# GO_VERSION is passed by autobahn/script/test.sh from the host's
# `go env GOVERSION`, so the server under test is built with the same Go as the
# CI matrix entry. The default is only a fallback for manual builds.
ARG GO_VERSION=1.27
FROM golang:${GO_VERSION}-alpine

WORKDIR /go/src/github.com/gobwas/ws

Expand Down
16 changes: 12 additions & 4 deletions autobahn/script/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

FOLLOW_LOGS=0

# Build the server image with the same Go version as the host (e.g. the CI
# matrix entry). GO_VERSION may be set explicitly to override it.
GO_VERSION="${GO_VERSION:-$(go env GOVERSION 2>/dev/null | sed 's/^go//')}"
SERVER_BUILD_ARGS=()
if [[ -n "$GO_VERSION" ]]; then
SERVER_BUILD_ARGS+=(--build-arg "GO_VERSION=$GO_VERSION")
fi

while [[ $# -gt 0 ]]; do
key="$1"
case $key in
Expand All @@ -13,16 +21,16 @@ while [[ $# -gt 0 ]]; do
--build)
case "$2" in
autobahn)
docker build . --file autobahn/docker/autobahn/Dockerfile --tag ws-autobahn
docker build . --file autobahn/docker/autobahn/Dockerfile --tag ws-autobahn || exit 1
shift
;;
server)
docker build . --file autobahn/docker/server/Dockerfile --tag ws-server
docker build . --file autobahn/docker/server/Dockerfile --tag ws-server "${SERVER_BUILD_ARGS[@]}" || exit 1
shift
;;
*)
docker build . --file autobahn/docker/autobahn/Dockerfile --tag ws-autobahn
docker build . --file autobahn/docker/server/Dockerfile --tag ws-server
docker build . --file autobahn/docker/autobahn/Dockerfile --tag ws-autobahn || exit 1
docker build . --file autobahn/docker/server/Dockerfile --tag ws-server "${SERVER_BUILD_ARGS[@]}" || exit 1
;;
esac
;;
Expand Down
Loading