Skip to content

Commit a353497

Browse files
authored
Stop adding package source code into the release Docker images (#6040)
The policy that mandated this is no longer relevant now that CVAT is no longer developed by Intel. Moreover, the source code included was not even complete (it didn't contain Python or NPM packages). This saves ~1.6 GB in the unpacked image (and probably a bunch of build time too, but I didn't measure it).
1 parent b8cdd4e commit a353497

File tree

4 files changed

+6
-25
lines changed

4 files changed

+6
-25
lines changed

.github/workflows/publish_docker_images.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v3
1111
- name: Build images
1212
run: |
13-
CVAT_VERSION=latest CLAM_AV=yes INSTALL_SOURCES=yes docker compose -f docker-compose.yml -f docker-compose.dev.yml build
13+
CVAT_VERSION=latest CLAM_AV=yes docker compose -f docker-compose.yml -f docker-compose.dev.yml build
1414
- name: Login to Docker Hub
1515
uses: docker/login-action@v1
1616
with:

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- TDB
1111

1212
### Changed
13-
- TDB
13+
- Docker images no longer include Ubuntu package sources or FFmpeg/OpenH264 sources
14+
(<https://github.com/opencv/cvat/pull/6040>)
1415

1516
### Deprecated
1617
- TDB

Dockerfile

+3-22
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,16 @@ ENV FFMPEG_VERSION=4.3.1 \
3030
OPENH264_VERSION=2.1.1
3131

3232
WORKDIR /tmp/openh264
33-
RUN curl -sL https://github.com/cisco/openh264/archive/v${OPENH264_VERSION}.tar.gz --output openh264-${OPENH264_VERSION}.tar.gz && \
34-
tar -zx --strip-components=1 -f openh264-${OPENH264_VERSION}.tar.gz && \
33+
RUN curl -sL https://github.com/cisco/openh264/archive/v${OPENH264_VERSION}.tar.gz --output - | \
34+
tar -zx --strip-components=1 && \
3535
make -j5 && make install-shared PREFIX=${PREFIX} && make clean
3636

3737
WORKDIR /tmp/ffmpeg
3838
RUN curl -sL https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 --output - | \
3939
tar -jx --strip-components=1 && \
4040
./configure --disable-nonfree --disable-gpl --enable-libopenh264 \
4141
--enable-shared --disable-static --disable-doc --disable-programs --prefix="${PREFIX}" && \
42-
# make clean keeps the configuration files that let to know how the original sources were used to create the binary
43-
make -j5 && make install && make clean && \
44-
tar -zcf "/tmp/ffmpeg-$FFMPEG_VERSION.tar.gz" . && mv "/tmp/ffmpeg-$FFMPEG_VERSION.tar.gz" .
42+
make -j5 && make install && make clean
4543

4644
# Build wheels for all dependencies
4745
ARG PIP_VERSION
@@ -132,23 +130,6 @@ RUN if [ "$CLAM_AV" = "yes" ]; then \
132130
rm -rf /var/lib/apt/lists/*; \
133131
fi
134132

135-
ARG INSTALL_SOURCES='no'
136-
WORKDIR ${HOME}/sources
137-
RUN if [ "$INSTALL_SOURCES" = "yes" ]; then \
138-
sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list && \
139-
apt-get update && \
140-
dpkg --get-selections | while read -r line; do \
141-
package=$(echo "$line" | awk '{print $1}'); \
142-
mkdir "$package"; \
143-
( \
144-
cd "$package"; \
145-
apt-get -q --download-only source "$package"; \
146-
) \
147-
done && \
148-
rm -rf /var/lib/apt/lists/*; \
149-
fi
150-
COPY --from=build-image /tmp/openh264/openh264*.tar.gz /tmp/ffmpeg/ffmpeg*.tar.gz ${HOME}/sources/
151-
152133
# Install wheels from the build image
153134
RUN python3 -m venv /opt/venv
154135
ENV PATH="/opt/venv/bin:${PATH}"

docker-compose.dev.yml

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ services:
1818
https_proxy:
1919
socks_proxy:
2020
CLAM_AV:
21-
INSTALL_SOURCES:
2221
CVAT_DEBUG_ENABLED:
2322
environment:
2423
CVAT_DEBUG_ENABLED: '${CVAT_DEBUG_ENABLED:-no}'

0 commit comments

Comments
 (0)