Skip to content

Commit 5f517b3

Browse files
Create Dockerfile for deps and smoke test scripts
### Usage example # Build - from the ROOT of the repository docker build --build-arg SCRIPT=smoke_test.py -f scripts/bintars/BUILD/Dockerfile -t local:bintar_smoke_test . docker build --build-arg SCRIPT=deps_test.py -f scripts/bintars/BUILD/Dockerfile -t local:bintar_deps_test . # Interactive session (for debugging) docker run --rm -it --entrypoint=/bin/bash local:bintar_deps_test docker run --rm -it --entrypoint=/bin/bash local:bintar_smoke_test # deps test - mount a volume for mariadb archive $ docker run --rm -v /home/razvan/Documents/bincheck:/runtime \ local:bintar_deps_test \ /runtime/mariadb-10.6.21-linux-systemd-x86_64.tar.gz config/deps_10.6.yaml --- INFO: Product version (major.minor) 10.6 INFO: Extracting archive /runtime/mariadb-10.6.21-linux-systemd-x86_64.tar.gz INFO: Fetching archive dependencies INFO: Cleaned up tests/mariadb-10.6.21-linux-systemd-x86_64 INFO: All OK --- # smoke test - mount a volume for mariadb archive and docker socket (Docker Out of Docker) # is important that the test-directory is a bind mounted host path # so the script can further mount volumes for sibling containers $ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \ -v /tmp/buildnumber-builder:/tmp/buildnumber-builder \ -v /home/razvan/Documents/bincheck:/runtime \ local:bintar_smoke_test \ /runtime/mariadb-10.6.21-linux-systemd-x86_64.tar.gz \ config/supported_os.yaml --test_directory /tmp/buildnumber-builder --- INFO: Product version (major.minor) 10.6 INFO: Extracting archive /runtime/mariadb-10.6.21-linux-systemd-x86_64.tar.gz INFO: Using docker socket http+docker://localhost INFO: [1/2]: ubuntu:20.04 PASS INFO: [2/2]: ubuntu:22.04 PASS INFO: ------ TEST SUMMARY ------ INFO: PASSED: [ubuntu:20.04, ubuntu:22.04] INFO: Cleaned up /tmp/buildnumber-builder/mariadb-10.6.21-linux-systemd-x86_64 --- # These are written as ROOT. Buildbot-Worker cannot clean them /tmp$ tree buildnumber-builder/ buildnumber-builder/ ├── ubuntu_20.04 └── ubuntu_22.04
1 parent c4b0262 commit 5f517b3

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

scripts/bintars/BUILD/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#TODO(Razvan): GitHub workflow to build and push the images to QUAY/GHCR
2+
# Not urgent, when the scripts will be integrated with BuildBot
3+
FROM python:3.12-slim-bookworm
4+
5+
ARG SCRIPT
6+
7+
WORKDIR /bintcheck
8+
RUN apt-get update \
9+
&& apt-get -y upgrade \
10+
#binutils required for readelf, libmagic for python-magic
11+
&& apt-get install -y libmagic1 binutils dumb-init \
12+
&& apt-get clean
13+
14+
COPY scripts/bintars/*.py /bintcheck/
15+
COPY scripts/bintars/BUILD/requirements.txt /bintcheck
16+
COPY runtime_config/bintar_deps/*.yaml /bintcheck/config/
17+
18+
RUN pip install --no-cache-dir -r requirements.txt
19+
20+
ENV SCRIPT=${SCRIPT}
21+
# sh -c required for variable substitution
22+
# use dumb-init to run as PID 1 in container
23+
ENTRYPOINT ["dumb-init", "sh", "-c", "python -u ${SCRIPT} \"$@\"", "--"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
python-magic
2+
setuptools
3+
pyyaml
4+
docker==4.3.1
5+
requests==2.29.0
6+
urllib3==1.26.20

0 commit comments

Comments
 (0)