chore: Speed up docker builds a bit by reducing layer count.

This is especially noticeable on local builds (less so on the github
workers).
This commit is contained in:
iphydf 2024-01-25 15:32:17 +00:00
parent d6d67d56f3
commit 8328449c1a
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
35 changed files with 152 additions and 113 deletions

View File

@ -21,10 +21,17 @@ jobs:
steps: steps:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
with:
driver: docker
- name: Build toxchat/c-toxcore:sources
uses: docker/build-push-action@v4
with:
file: other/docker/sources/sources.Dockerfile
tags: toxchat/c-toxcore:sources
- name: Docker Build - name: Docker Build
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
with: with:
file: other/docker/${{ matrix.tool }}/Dockerfile file: other/docker/${{ matrix.tool }}/${{ matrix.tool }}.Dockerfile
coverage-linux: coverage-linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -121,19 +121,12 @@ jobs:
steps: steps:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
with:
driver: docker
- name: Login to DockerHub - name: Login to DockerHub
if: ${{ github.event_name == 'push' }} if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build toxchat/c-toxcore:sources
uses: docker/build-push-action@v4
with:
file: other/docker/sources/Dockerfile
tags: toxchat/c-toxcore:sources
- name: Build and push - name: Build and push
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
with: with:

View File

@ -135,6 +135,7 @@ static void test_save_compatibility(const char *save_path)
tox_kill(tox); tox_kill(tox);
} }
// cppcheck-suppress constParameter
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
char base_path[4096] = {0}; char base_path[4096] = {0};

View File

@ -170,6 +170,7 @@ int main(int argc, char *argv[])
if (!(onion && forwarding && onion_a)) { if (!(onion && forwarding && onion_a)) {
printf("Something failed to initialize.\n"); printf("Something failed to initialize.\n");
// cppcheck-suppress resourceLeak
return 1; return 1;
} }
@ -178,6 +179,7 @@ int main(int argc, char *argv[])
perror("Initialization"); perror("Initialization");
if (!manage_keys(dht)) { if (!manage_keys(dht)) {
// cppcheck-suppress resourceLeak
return 1; return 1;
} }
printf("Public key: "); printf("Public key: ");
@ -189,6 +191,7 @@ int main(int argc, char *argv[])
if (tcp_s == nullptr) { if (tcp_s == nullptr) {
printf("TCP server failed to initialize.\n"); printf("TCP server failed to initialize.\n");
// cppcheck-suppress resourceLeak
return 1; return 1;
} }
@ -199,6 +202,7 @@ int main(int argc, char *argv[])
if (file == nullptr) { if (file == nullptr) {
printf("Could not open file \"%s\" for writing. Exiting...\n", public_id_filename); printf("Could not open file \"%s\" for writing. Exiting...\n", public_id_filename);
// cppcheck-suppress resourceLeak
return 1; return 1;
} }

View File

@ -1,5 +1,6 @@
################################################ ################################################
# autotools-linux # autotools-linux
FROM toxchat/c-toxcore:sources AS sources
FROM ubuntu:22.04 FROM ubuntu:22.04
RUN apt-get update && \ RUN apt-get update && \
@ -24,7 +25,12 @@ USER builder
WORKDIR /home/builder WORKDIR /home/builder
# Copy the sources and run the build. # Copy autotools-specific build scripts not present in the sources image.
# These change less frequently than the sources, thus are copied first.
COPY --chown=builder:builder . /home/builder/c-toxcore/ COPY --chown=builder:builder . /home/builder/c-toxcore/
# Copy the sources and run the build.
COPY --chown=builder:builder --from=sources /src/ /home/builder/c-toxcore/
WORKDIR /home/builder/c-toxcore WORKDIR /home/builder/c-toxcore
RUN CC=gcc .github/scripts/autotools-linux RUN CC=gcc .github/scripts/autotools-linux

View File

@ -0,0 +1,12 @@
**/*
!.github/scripts/autotools-linux
!m4/*
!configure.ac
!*.pc.in
!*.spec.in
!**/Makefile.am
!**/Makefile.inc
!docs/updates/*
!other/DHTnodes
!other/astyle/*
!other/tox.png

View File

@ -2,4 +2,5 @@
set -eux set -eux
BUILD=autotools BUILD=autotools
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/Dockerfile" . other/docker/sources/build
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .

View File

@ -1,3 +1,4 @@
FROM toxchat/c-toxcore:sources AS sources
FROM alpine:3.19.0 FROM alpine:3.19.0
RUN ["apk", "add", "--no-cache", \ RUN ["apk", "add", "--no-cache", \
@ -16,6 +17,8 @@ RUN ["apk", "add", "--no-cache", \
ENV CC=clang CXX=clang++ ENV CC=clang CXX=clang++
COPY . /c-toxcore/ COPY --from=sources /src/ /c-toxcore/
COPY other/analysis/run-clang-tidy other/analysis/variants.sh /c-toxcore/other/analysis/
COPY .clang-tidy /c-toxcore/
WORKDIR /c-toxcore WORKDIR /c-toxcore
RUN other/analysis/run-clang-tidy RUN other/analysis/run-clang-tidy

View File

@ -2,4 +2,5 @@
set -eux set -eux
BUILD=clang-tidy BUILD=clang-tidy
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/Dockerfile" . other/docker/sources/build
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .

View File

@ -1,3 +1,4 @@
FROM toxchat/c-toxcore:sources AS sources
FROM toxchat/compcert:latest FROM toxchat/compcert:latest
RUN apt-get update && \ RUN apt-get update && \
@ -8,15 +9,10 @@ RUN apt-get update && \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /work WORKDIR /work
COPY auto_tests/ /work/auto_tests/ COPY --from=sources /src/ /work/
COPY testing/ /work/testing/
COPY toxav/ /work/toxav/
COPY toxcore/ /work/toxcore/
COPY toxencryptsave/ /work/toxencryptsave/
COPY third_party/ /work/third_party/
SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY other/docker/compcert/Makefile /work/ COPY other/docker/compcert/Makefile /work/
RUN make "-j$(nproc)" RUN make "-j$(nproc)"
RUN ./send_message_test #| grep 'tox clients connected' RUN ./send_message_test | grep 'tox clients connected'

View File

@ -2,4 +2,5 @@
set -eux set -eux
BUILD=compcert BUILD=compcert
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/Dockerfile" . other/docker/sources/build
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .

View File

@ -1,4 +1,4 @@
FROM toxchat/c-toxcore:sources AS src FROM toxchat/c-toxcore:sources AS sources
FROM ubuntu:20.04 AS build FROM ubuntu:20.04 AS build
SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@ -41,7 +41,7 @@ ENV CC=clang-17 \
PYTHONUNBUFFERED=1 \ PYTHONUNBUFFERED=1 \
PATH=$PATH:/usr/lib/go-1.18/bin PATH=$PATH:/usr/lib/go-1.18/bin
COPY --from=src /src/ /work/ COPY --from=sources /src/ /work/
WORKDIR /work WORKDIR /work
RUN git clone --depth=1 https://github.com/TokTok/toktok-fuzzer /work/testing/fuzzing/toktok-fuzzer RUN git clone --depth=1 https://github.com/TokTok/toktok-fuzzer /work/testing/fuzzing/toktok-fuzzer

View File

@ -4,6 +4,8 @@ set -eux
read -a ci_env <<<"$(bash <(curl -s https://codecov.io/env))" read -a ci_env <<<"$(bash <(curl -s https://codecov.io/env))"
docker build -t toxchat/c-toxcore:sources -f other/docker/sources/Dockerfile . BUILD=coverage
docker build -t toxchat/c-toxcore:coverage -f other/docker/coverage/Dockerfile . other/docker/sources/build
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .
docker run "${ci_env[@]}" -e CI=true --name toxcore-coverage --rm -t toxchat/c-toxcore:coverage /usr/local/bin/codecov docker run "${ci_env[@]}" -e CI=true --name toxcore-coverage --rm -t toxchat/c-toxcore:coverage /usr/local/bin/codecov

View File

@ -2,7 +2,9 @@
set -eux set -eux
docker build -t toxchat/c-toxcore:sources -f other/docker/sources/Dockerfile . BUILD=coverage
docker build -t toxchat/c-toxcore:coverage -f other/docker/coverage/Dockerfile . other/docker/sources/build
docker build -t toxchat/c-toxcore:coverage-nginx -f other/docker/coverage/Dockerfile.nginx other/docker/coverage docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .
docker build -t toxchat/c-toxcore:coverage-nginx -f other/docker/coverage/nginx.Dockerfile other/docker/coverage
docker run --name toxcore-coverage --rm -it -p "28192:80" toxchat/c-toxcore:coverage-nginx docker run --name toxcore-coverage --rm -it -p "28192:80" toxchat/c-toxcore:coverage-nginx

View File

@ -1,30 +0,0 @@
FROM alpine:3.19.0
RUN ["apk", "add", "--no-cache", \
"bash", \
"cppcheck", \
"findutils", \
"libconfig-dev", \
"libsodium-dev", \
"libvpx-dev", \
"linux-headers", \
"make", \
"opus-dev"]
COPY other/bootstrap_daemon/ /src/workspace/c-toxcore/other/bootstrap_daemon/
COPY other/bootstrap_node_packets.* /src/workspace/c-toxcore/other/
COPY other/fun/ /src/workspace/c-toxcore/other/fun/
COPY auto_tests/check_compat.h /src/workspace/c-toxcore/auto_tests/
COPY testing/ /src/workspace/c-toxcore/testing/
COPY toxav/ /src/workspace/c-toxcore/toxav/
COPY toxcore/ /src/workspace/c-toxcore/toxcore/
COPY toxencryptsave/ /src/workspace/c-toxcore/toxencryptsave/
COPY third_party/cmp/cmp.h /src/workspace/c-toxcore/third_party/cmp/
COPY other/analysis/run-cppcheck \
other/analysis/gen-file.sh \
other/analysis/variants.sh \
/src/workspace/c-toxcore/other/analysis/
COPY other/docker/cppcheck/toxcore.cfg \
/src/workspace/c-toxcore/other/docker/cppcheck/
WORKDIR /src/workspace/c-toxcore
RUN ["other/analysis/run-cppcheck"]

View File

@ -0,0 +1,23 @@
FROM toxchat/c-toxcore:sources AS sources
FROM alpine:3.19.0
RUN ["apk", "add", "--no-cache", \
"bash", \
"cppcheck", \
"findutils", \
"libconfig-dev", \
"libsodium-dev", \
"libvpx-dev", \
"linux-headers", \
"make", \
"opus-dev"]
COPY --from=sources /src/ /src/workspace/c-toxcore/
COPY other/analysis/run-cppcheck \
other/analysis/gen-file.sh \
other/analysis/variants.sh \
/src/workspace/c-toxcore/other/analysis/
COPY other/docker/cppcheck/toxcore.cfg \
/src/workspace/c-toxcore/other/docker/cppcheck/
WORKDIR /src/workspace/c-toxcore
RUN ["other/analysis/run-cppcheck"]

View File

@ -2,4 +2,5 @@
set -eux set -eux
BUILD=cppcheck BUILD=cppcheck
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/Dockerfile" . other/docker/sources/build
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .

View File

@ -1,4 +1,5 @@
FROM alpine:latest AS build FROM toxchat/c-toxcore:sources AS sources
FROM alpine:3.19.0 AS build
ENV LANG=en_US.UTF-8 \ ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \ LANGUAGE=en_US.UTF-8 \
@ -8,9 +9,9 @@ ENV LANG=en_US.UTF-8 \
RUN apk add --no-cache doxygen git graphviz texlive \ RUN apk add --no-cache doxygen git graphviz texlive \
&& git clone --depth=1 https://github.com/jothepro/doxygen-awesome-css.git /work/doxygen-awesome-css && git clone --depth=1 https://github.com/jothepro/doxygen-awesome-css.git /work/doxygen-awesome-css
WORKDIR /work WORKDIR /work
COPY . /work/ COPY --from=sources /src/ /work/
RUN cat docs/Doxyfile > Doxyfile \ COPY docs/Doxyfile /work/Doxyfile
&& echo "WARN_AS_ERROR = YES" >> Doxyfile \ RUN echo "WARN_AS_ERROR = YES" >> Doxyfile \
&& sed -i -e 's/^non_null([^)]*) *//;s/^nullable([^)]*) *//' $(find . -name "*.[ch]") \ && sed -i -e 's/^non_null([^)]*) *//;s/^nullable([^)]*) *//' $(find . -name "*.[ch]") \
&& doxygen Doxyfile && doxygen Doxyfile

View File

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
set -eux set -eux
BUILD=doxygen
other/docker/sources/build
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .
docker build -t toxchat/c-toxcore:docs -f other/docker/doxygen/Dockerfile . docker run --name toxcore-doxygen --rm -it -p "28192:80" "toxchat/c-toxcore:$BUILD"
docker run --name toxcore-docs --rm -it -p "28192:80" toxchat/c-toxcore:docs

View File

@ -1,3 +1,4 @@
FROM toxchat/c-toxcore:sources AS sources
FROM ghcr.io/goblint/analyzer:latest FROM ghcr.io/goblint/analyzer:latest
RUN apt-get update && \ RUN apt-get update && \
@ -8,15 +9,9 @@ RUN apt-get update && \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /work WORKDIR /work
COPY auto_tests/ /work/auto_tests/ COPY --from=sources /src/ /work/
COPY testing/ /work/testing/
COPY toxav/ /work/toxav/
COPY toxcore/ /work/toxcore/
COPY toxencryptsave/ /work/toxencryptsave/
COPY third_party/ /work/third_party/
COPY other/make_single_file /work/other/ COPY other/make_single_file /work/other/
COPY other/docker/goblint/sodium.c /work/other/docker/goblint/
RUN other/make_single_file -core auto_tests/tox_new_test.c other/docker/goblint/sodium.c > analysis.c RUN other/make_single_file -core auto_tests/tox_new_test.c other/docker/goblint/sodium.c > analysis.c
# Try compiling+linking just to make sure we have all the fake functions. # Try compiling+linking just to make sure we have all the fake functions.

View File

@ -2,4 +2,5 @@
set -eux set -eux
BUILD=goblint BUILD=goblint
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/Dockerfile" . other/docker/sources/build
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .

View File

@ -1,9 +1,7 @@
FROM toxchat/c-toxcore:sources AS sources
FROM toxchat/infer:latest FROM toxchat/infer:latest
COPY toxav/ /work/c-toxcore/toxav/ COPY --from=sources /src/ /work/c-toxcore/
COPY toxcore/ /work/c-toxcore/toxcore/
COPY toxencryptsave/ /work/c-toxcore/toxencryptsave/
COPY third_party/ /work/c-toxcore/third_party/
RUN infer capture -- clang++ -fsyntax-only \ RUN infer capture -- clang++ -fsyntax-only \
$(pkg-config --cflags libconfig libsodium opus vpx) \ $(pkg-config --cflags libconfig libsodium opus vpx) \
/work/c-toxcore/toxav/*.c \ /work/c-toxcore/toxav/*.c \

View File

@ -2,4 +2,5 @@
set -eux set -eux
BUILD=infer BUILD=infer
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/Dockerfile" . other/docker/sources/build
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .

View File

@ -155,7 +155,12 @@ SUPPRESSIONS += 21.10
CPPFLAGS := -DCMP_NO_FLOAT=1 -DMIN_LOGGER_LEVEL=LOGGER_LEVEL_TRACE CPPFLAGS := -DCMP_NO_FLOAT=1 -DMIN_LOGGER_LEVEL=LOGGER_LEVEL_TRACE
SOURCES := $(shell find /src/workspace/c-toxcore -name "*.c") FIND_FLAGS := -name "*.c" \
-and -not -wholename "*/auto_tests/*" \
-and -not -wholename "*/other/*" \
-and -not -wholename "*/super_donators/*" \
-and -not -wholename "*/third_party/*"
SOURCES := $(shell find /src/workspace/c-toxcore $(FIND_FLAGS))
analyse: $(DUMPS:.dump=.diag) analyse: $(DUMPS:.dump=.diag)
cppcheck --error-exitcode=1 -j8 --addon=misra --suppress=doubleFree $(patsubst %,--suppress=misra-c2012-%,$(SUPPRESSIONS)) $(CPPFLAGS) $(SOURCES) cppcheck --error-exitcode=1 -j8 --addon=misra --suppress=doubleFree $(patsubst %,--suppress=misra-c2012-%,$(SUPPRESSIONS)) $(CPPFLAGS) $(SOURCES)

View File

@ -1,3 +1,4 @@
FROM toxchat/c-toxcore:sources AS sources
FROM ubuntu:20.04 FROM ubuntu:20.04
RUN apt-get update && \ RUN apt-get update && \
@ -12,10 +13,7 @@ RUN apt-get update && \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY toxav/ /src/workspace/c-toxcore/toxav/ COPY --from=sources /src/ /src/workspace/c-toxcore/
COPY toxcore/ /src/workspace/c-toxcore/toxcore/
COPY toxencryptsave/ /src/workspace/c-toxcore/toxencryptsave/
COPY third_party/cmp/cmp.h /src/workspace/c-toxcore/third_party/cmp/cmp.h
COPY other/docker/misra/Makefile /src/workspace/ COPY other/docker/misra/Makefile /src/workspace/
WORKDIR /src/workspace WORKDIR /src/workspace
RUN ["make"] RUN ["make"]

View File

@ -2,4 +2,5 @@
set -eux set -eux
BUILD=misra BUILD=misra
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/Dockerfile" . other/docker/sources/build
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .

View File

@ -1,17 +0,0 @@
FROM scratch
# Roughly in order of change frequency.
COPY third_party/ /src/third_party/
COPY .github/scripts/flags*.sh /src/.github/scripts/
COPY other/proxy/ /src/other/proxy/
COPY cmake/ /src/cmake/
COPY other/bootstrap_daemon/ /src/other/bootstrap_daemon/
COPY other/pkgconfig/ /src/other/pkgconfig/
COPY other/rpm/ /src/other/rpm/
COPY other/*.[ch] /src/other/
COPY CMakeLists.txt so.version /src/
COPY toxencryptsave/ /src/toxencryptsave/
COPY testing/ /src/testing/
COPY toxav/ /src/toxav/
COPY toxcore/ /src/toxcore/
COPY auto_tests/ /src/auto_tests/

5
other/docker/sources/build Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
set -eux
BUILD=sources
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .

View File

@ -0,0 +1,2 @@
FROM scratch
COPY . /src/

View File

@ -0,0 +1,22 @@
# Ignore everything ...
**/*
# ... except sources
!**/*.[ch]
!**/*.cc
!**/*.hh
!CHANGELOG.md
!LICENSE
!README.md
!auto_tests/data/*
!other/bootstrap_daemon/bash-completion/**
!other/bootstrap_daemon/tox-bootstrapd.*
!other/proxy/*.mod
!other/proxy/*.sum
!other/proxy/*.go
# ... and CMake build files (used by most builds).
!**/CMakeLists.txt
!.github/scripts/flags*.sh
!cmake/*.cmake
!other/pkgconfig/*
!other/rpm/*
!so.version

View File

@ -2,4 +2,5 @@
set -eux set -eux
BUILD=tcc BUILD=tcc
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/Dockerfile" . other/docker/sources/build
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .

View File

@ -1,3 +1,4 @@
FROM toxchat/c-toxcore:sources AS sources
FROM ubuntu:22.04 FROM ubuntu:22.04
RUN apt-get update && \ RUN apt-get update && \
@ -12,12 +13,7 @@ RUN apt-get update && \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /work WORKDIR /work
COPY auto_tests/ /work/auto_tests/ COPY --from=sources /src/ /work/
COPY testing/ /work/testing/
COPY toxav/ /work/toxav/
COPY toxcore/ /work/toxcore/
COPY toxencryptsave/ /work/toxencryptsave/
COPY third_party/ /work/third_party/
SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]

View File

@ -2,4 +2,5 @@
set -eux set -eux
BUILD=tokstyle BUILD=tokstyle
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/Dockerfile" . other/docker/sources/build
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .

View File

@ -1,3 +1,4 @@
FROM toxchat/c-toxcore:sources AS sources
FROM toxchat/haskell:hs-tokstyle AS tokstyle FROM toxchat/haskell:hs-tokstyle AS tokstyle
FROM ubuntu:22.04 FROM ubuntu:22.04
@ -15,8 +16,11 @@ RUN apt-get update && \
COPY --from=tokstyle /bin/check-c /bin/ COPY --from=tokstyle /bin/check-c /bin/
RUN ["git", "clone", "--depth=1", "https://github.com/TokTok/hs-tokstyle", "/src/workspace/hs-tokstyle"] RUN ["git", "clone", "--depth=1", "https://github.com/TokTok/hs-tokstyle", "/src/workspace/hs-tokstyle"]
COPY toxav/ /src/workspace/c-toxcore/toxav/ COPY --from=sources /src/ /src/workspace/c-toxcore/
COPY toxcore/ /src/workspace/c-toxcore/toxcore/ RUN /bin/check-c $(find /src/workspace/c-toxcore -name "*.c" \
COPY toxencryptsave/ /src/workspace/c-toxcore/toxencryptsave/ -and -not -wholename "*/auto_tests/*" \
COPY third_party/cmp/cmp.h /src/workspace/c-toxcore/third_party/cmp/cmp.h -and -not -wholename "*/other/*" \
RUN /bin/check-c $(find /src/workspace/c-toxcore -name "*.c") -and -not -wholename "*/super_donators/*" \
-and -not -wholename "*/testing/*" \
-and -not -wholename "*/third_party/cmp/examples/*" \
-and -not -wholename "*/third_party/cmp/test/*")