File tree Expand file tree Collapse file tree 7 files changed +56
-42
lines changed
Expand file tree Collapse file tree 7 files changed +56
-42
lines changed Original file line number Diff line number Diff line change 1+ Containerfile
2+ differ
3+ dist
4+ out
5+ tls-secrets
6+ .venv
7+ work
8+ ** /__pycache__
9+
Original file line number Diff line number Diff line change 22/.test-data
33/dist
44/out /*
5+ /uv.lock
56/tls-secrets /*
67/work /*
78/flatpak_indexer /certs /RH-IT-Root-CA.crt
Original file line number Diff line number Diff line change 1- [submodule "differ/ tar-diff "]
2- path = differ/ tar-diff
1+ [submodule "tar-diff "]
2+ path = tar-diff
33 url = https://github.com/containers/tar-diff
Original file line number Diff line number Diff line change 1+ FROM registry.access.redhat.com/ubi9/go-toolset as tar-diff-builder
2+
3+ USER root
4+ ADD tar-diff /tmp/src
5+ RUN chown -R 1001:0 /tmp/src
6+
7+ USER 1001
8+
9+ # We need to pass -buildvcs=false because we only copy part of the git checkout
10+ RUN cd /tmp/src && go build -buildvcs=false -o /opt/app-root/bin/tar-diff ./cmd/tar-diff
11+
12+ FROM registry.access.redhat.com/ubi9/python-312 as builder
13+
14+ ARG FLATPAK_INDEXER_UPDATE_TEST_DATA=false
15+ ENV FLATPAK_INDEXER_UPDATE_TEST_DATA=${FLATPAK_INDEXER_UPDATE_TEST_DATA}
16+
17+ # Add application sources to a directory that the assemble script expects them
18+ # and set permissions so that the container runs without root access
19+ USER 0
20+ ADD . /tmp/src
21+ RUN /usr/bin/fix-permissions /tmp/src
22+ USER 1001
23+
24+ # Install the application's dependencies from PyPI
25+ RUN /bin/sh /tmp/src/.s2i/bin/assemble
26+
27+ FROM registry.access.redhat.com/ubi9/python-312-minimal
28+
29+ USER 0
30+ RUN microdnf -y install time && microdnf clean all
31+ USER 1001
32+
33+ # Copy the tar-diff binary from the tar-diff-builder image
34+ COPY --from=tar-diff-builder /opt/app-root/bin/tar-diff /opt/app-root/bin/
35+
36+ # Copy app sources together with the whole virtual environment from the builder image
37+ COPY --from=builder /opt/app-root /opt/app-root
38+
39+ # Run tests
40+ RUN $APP_ROOT/src/tools/test.sh
41+
42+ # Set the default command for the resulting image
43+ CMD /usr/libexec/s2i/run
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 44
55origin=$( cd $( dirname $0 ) /.. && pwd)
66
7- tmp_container=
8- work=$( mktemp -d)
9- cleanup () {
10- :
11- # rm -rf $work
12- [ -n " $tmp_container " ] && podman rm $tmp_container
13- }
14- trap cleanup EXIT
15-
16- set -x
17-
18- podman build $origin /differ -t flatpak-indexer-tar-diff
19-
20- s2i build --copy --as-dockerfile=$work /Dockerfile $origin registry.access.redhat.com/ubi8/python-39 flatpak-indexer
21-
22- tmp_container=$( podman create flatpak-indexer-tar-diff)
23- mkdir -p -m 0755 $work /upload/src/bin
24- podman cp $tmp_container :/opt/app-root/tar-diff $work /upload/src/bin/tar-diff
25- podman cp $tmp_container :/usr/bin/time $work /upload/src/bin/time
26-
27- tmp_tag=" flatpak-indexer:$( date +%Y%m%d-%H%M%S) "
28- podman build $work -t $tmp_tag
29- if podman run --network=none --rm $tmp_tag tools/test.sh ; then
30- podman tag $tmp_tag flatpak-indexer:latest
31- podman rmi $tmp_tag
32- else
33- podman rmi $tmp_tag
34- exit 1
35- fi
7+ podman build -t flatpak-indexer:latest $origin
You can’t perform that action at this time.
0 commit comments