-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.test
More file actions
31 lines (27 loc) · 1017 Bytes
/
Dockerfile.test
File metadata and controls
31 lines (27 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Linux test runner. TCP_USER_TIMEOUT is a Linux-only socket option, so
# the kernel enforcement tests under test/linux and test/integration
# can't be exercised on macOS or BSD — `setsockopt` returns ENOPROTOOPT
# and the gem silently no-ops.
#
# Build:
# docker build -f Dockerfile.test -t tcp_user_timeout:linux .
#
# Run unit + middleware tests (cross-platform):
# docker run --rm -v $PWD:/app -w /app tcp_user_timeout:linux \
# bash -c "bundle install && bundle exec rake test"
#
# Run kernel enforcement tests (Linux-only):
# docker run --rm -v $PWD:/app -w /app tcp_user_timeout:linux \
# bash -c "bundle install && bundle exec rake test:linux"
#
FROM ruby:3.3-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
libyaml-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Use a separate volume for bundle so re-runs don't reinstall dependencies
ENV BUNDLE_PATH=/bundle BUNDLE_DISABLE_SHARED_GEMS=true
CMD ["bash"]