Skip to content

Commit d2d3843

Browse files
committed
Adjust Dockerfile, really exclude the tests from runtime
Uses a custom Dockerfile syntax.
1 parent cb36dd5 commit d2d3843

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax=docker/dockerfile:1.7-labs
12
FROM ghcr.io/r-lib/rig/ubuntu AS build
23

34
# do this first, because it never changes, so it'll sit in the Docker cache
@@ -13,13 +14,14 @@ RUN R -q -e 'pak::pkg_install("deps::.", lib = .Library); pak::cache_clean(); pa
1314
apt-get clean && \
1415
rm DESCRIPTION
1516

16-
# copy everything, minus the stuff in .dockerignore
17-
COPY . /app
17+
# copy everything, except the tests
18+
COPY --exclude=tests . /app
1819
WORKDIR /app
1920

2021
# -------------------------------------------------------------------------
2122
FROM build AS test
2223
RUN R -q -e 'pak::pkg_install("deps::.", dependencies = TRUE)'
24+
COPY tests /app/tests
2325
RUN R -q -e 'testthat::test_local()'
2426

2527
# -------------------------------------------------------------------------

0 commit comments

Comments
 (0)