Skip to content

Commit 187fe17

Browse files
committed
ci: don't stage packages in /tmp, reduce layers for cppcheck build
1 parent eef8635 commit 187fe17

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

contrib/containers/ci/Dockerfile

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,28 @@ RUN pip3 install \
111111
pyzmq==22.3.0 \
112112
vulture==2.3
113113

114-
# dash_hash
115114
ARG DASH_HASH_VERSION=1.4.0
116-
RUN git clone --depth 1 --no-tags --branch=${DASH_HASH_VERSION} https://github.com/dashpay/dash_hash
117-
RUN cd dash_hash && pip3 install -r requirements.txt .
115+
RUN set -ex; \
116+
cd /tmp; \
117+
git clone --depth 1 --no-tags --branch=${DASH_HASH_VERSION} https://github.com/dashpay/dash_hash; \
118+
cd dash_hash && pip3 install -r requirements.txt .; \
119+
cd .. && rm -rf dash_hash
120+
121+
ARG CPPCHECK_VERSION=2.13.0
122+
RUN set -ex; \
123+
curl -fL "https://github.com/danmar/cppcheck/archive/${CPPCHECK_VERSION}.tar.gz" -o /tmp/cppcheck.tar.gz; \
124+
mkdir -p /opt/cppcheck && tar -xzf /tmp/cppcheck.tar.gz -C /opt/cppcheck --strip-components=1 && rm /tmp/cppcheck.tar.gz; \
125+
cd /opt/cppcheck; \
126+
mkdir build && cd build && cmake .. && cmake --build . -j "$(( $(nproc) - 1 ))"; \
127+
mkdir /usr/local/share/Cppcheck && ln -s /opt/cppcheck/cfg/ /usr/local/share/Cppcheck/cfg; \
128+
rm -rf /tmp/cppcheck.tar.gz
129+
ENV PATH="/opt/cppcheck/build/bin:${PATH}"
130+
131+
ARG SHELLCHECK_VERSION=v0.7.1
132+
RUN set -ex; \
133+
curl -fL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" -o /tmp/shellcheck.tar.xz; \
134+
mkdir -p /opt/shellcheck && tar -xf /tmp/shellcheck.tar.xz -C /opt/shellcheck --strip-components=1 && rm /tmp/shellcheck.tar.xz
135+
ENV PATH="/opt/shellcheck:${PATH}"
118136

119137
# Add user with specified (or default) user/group ids and setup configuration files
120138
ARG USER_ID=1000
@@ -144,16 +162,6 @@ RUN apt-get update && apt-get install $APT_ARGS \
144162
xorriso \
145163
&& rm -rf /var/lib/apt/lists/*
146164

147-
ARG CPPCHECK_VERSION=2.13.0
148-
RUN curl -sL "https://github.com/danmar/cppcheck/archive/${CPPCHECK_VERSION}.tar.gz" | tar -xvzf - --directory /tmp/
149-
RUN cd /tmp/cppcheck-${CPPCHECK_VERSION} && mkdir build && cd build && cmake .. && cmake --build . -j 8
150-
ENV PATH="/tmp/cppcheck-${CPPCHECK_VERSION}/build/bin:${PATH}"
151-
RUN mkdir /usr/local/share/Cppcheck && ln -s /tmp/cppcheck-${CPPCHECK_VERSION}/cfg/ /usr/local/share/Cppcheck/cfg
152-
153-
ARG SHELLCHECK_VERSION=v0.7.1
154-
RUN curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
155-
ENV PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}"
156-
157165
# This is a hack. It is needed because gcc-multilib and g++-multilib are conflicting with g++-arm-linux-gnueabihf. This is
158166
# due to gcc-multilib installing the following symbolic link, which is needed for -m32 support. However, this causes
159167
# arm builds to also have the asm folder implicitly in the include search path. This is kind of ok, because the asm folder

0 commit comments

Comments
 (0)