Skip to content

Commit da6e120

Browse files
authored
Merge pull request #182 from artiomn/master
Docker build image separated from the base image, CUDA installation added
2 parents 6dcf95c + 34aa399 commit da6e120

9 files changed

Lines changed: 35249 additions & 294 deletions

File tree

.github/workflows/docker-build-image.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ on:
66
push:
77
branches: [ "master" ]
88
paths:
9-
- 'docker/build-image/**'
9+
- 'docker/**'
1010
- '.github/workflows/docker-build-image.yml'
1111
pull_request:
1212
branches: [ "master" ]
1313
paths:
14-
- 'docker/build-image/**'
14+
- 'docker/**'
1515
- '.github/workflows/docker-build-image.yml'
1616

1717
jobs:
1818
docker:
1919
runs-on: ubuntu-latest
2020
steps:
21+
- name: Set Images Version
22+
run: echo "KNP_IMAGE_VERSION=v1.0.${{ github.run_number }}" >> $GITHUB_ENV
2123
- name: Set up Docker
2224
uses: docker/setup-docker-action@v5
2325
with:
@@ -37,13 +39,25 @@ jobs:
3739
with:
3840
username: ${{ vars.DOCKERHUB_LOGIN }}
3941
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
- name: Build and push the base Docker image for Kaspersky Neuromorphic Platform
43+
uses: docker/build-push-action@v6
44+
with:
45+
platforms: linux/amd64,linux/arm64
46+
context: "{{defaultContext}}:docker/base-image"
47+
load: true
48+
push: true
49+
tags: ${{ vars.DOCKERHUB_LOGIN }}/knp-base-image:${{ env.KNP_IMAGE_VERSION }}
50+
build-args: KNP_IMAGE_VERSION=${{ env.KNP_IMAGE_VERSION }}
51+
timeout-minutes: 180
52+
continue-on-error: false
4053
- name: Build and push the Docker image for Kaspersky Neuromorphic Platform build
4154
uses: docker/build-push-action@v6
4255
with:
4356
platforms: linux/amd64,linux/arm64
4457
context: "{{defaultContext}}:docker/build-image"
4558
load: true
4659
push: true
47-
tags: ${{ vars.DOCKERHUB_LOGIN }}/knp-build-image:latest
60+
build-args: KNP_IMAGE_VERSION=${{ env.KNP_IMAGE_VERSION }}
61+
tags: ${{ vars.DOCKERHUB_LOGIN }}/knp-build-image:${{ env.KNP_IMAGE_VERSION }}
4862
timeout-minutes: 180
4963
continue-on-error: false

docker/base-image/Dockerfile

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Base image Dockerfile.
2+
#
3+
# © 2024-2026 AO Kaspersky Lab
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
ARG KNP_IMAGE_VERSION=2.0.0
18+
ARG TARGETPLATFORM
19+
FROM gcc:14.2.0
20+
21+
ENV DEBIAN_FRONTEND=noninteractive
22+
23+
WORKDIR /azp
24+
25+
RUN \
26+
echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes \
27+
&& export DEBIAN_VERSION=debian$(cat /etc/debian_version | sed 's/\..*//') \
28+
&& apt-get update \
29+
&& apt-get -y --no-install-recommends --show-progress install \
30+
apt-transport-https \
31+
build-essential \
32+
ca-certificates \
33+
cmake \
34+
curl \
35+
gdbserver \
36+
git \
37+
gnupg-agent \
38+
jq \
39+
libcurl4 \
40+
libunwind8 \
41+
netcat-openbsd \
42+
net-tools \
43+
libopencv-dev \
44+
p7zip-full \
45+
python3 \
46+
python3-opencv \
47+
python3-pip \
48+
python3-requests \
49+
python3-types-requests \
50+
software-properties-common \
51+
ssh \
52+
strace \
53+
tar \
54+
valgrind \
55+
wget \
56+
zip \
57+
$(apt list|awk '/boost.*1.81.*-dev/ {print($1);}') \
58+
&& apt-get clean \
59+
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
60+
gpg --dearmor | tee /etc/apt/keyrings/docker.gpg > /dev/null \
61+
&& add-apt-repository \
62+
"deb [arch=$(echo ${TARGETPLATFORM}|cut -f2 -d/)] https://download.docker.com/linux/ubuntu \
63+
mantic \
64+
stable" \
65+
&& export VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r) \
66+
&& export DESTINATION=/usr/local/bin/docker-compose \
67+
&& curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-`uname -s`-`uname -m` -o "${DESTINATION}" \
68+
&& chmod +x ${DESTINATION} \
69+
&& ln -sf ${DESTINATION} /usr/bin/docker-compose
70+
71+
RUN rm -rf /tmp/*
72+
73+
COPY LICENSE.txt .
74+
COPY NOTICE.txt .
75+
76+
COPY start.sh /start.sh
77+
RUN chmod +x /start.sh
78+
79+
ENTRYPOINT ["/start.sh"]

0 commit comments

Comments
 (0)