Staging instance, all changes can be removed at any time

Skip to content

docker/build_image.sh: Add script to build/ push to docker registry

Related to swh/infra/sysadm-environment#4105 (closed)

Test Plan

Executed to only build and not push for now (with set -x):

PUBLISH=no ./build_image.sh
++ date +%Y%m%d
+ builddate=20220329
++ date +%H%M%S
+ buildtime=161951
+ builddatetime=20220329-161951
++ docker info
++ grep Username
++ awk '{print $2}'
+ username=ardumont
+ img=softwareheritage/maven-index-exporter
+ docker build --file Dockerfile --tag softwareheritage/maven-index-exporter:20220329-161951 .
Sending build context to Docker daemon  34.82kB
Step 1/8 : FROM adoptopenjdk/openjdk11:debian-jre
 ---> e4102b823981
Step 2/8 : ADD https://github.com/javasoze/clue/releases/download/release-6.2.0-1.0.0/clue-6.2.0-1.0.0.jar /opt/
Downloading [==================================================>]     18MB/18MB

 ---> Using cache
 ---> 4740fa64ca63
Step 3/8 : ADD https://repo1.maven.org/maven2/org/apache/maven/indexer/indexer-cli/6.0.0/indexer-cli-6.0.0.jar /opt/
Downloading [==================================================>]  14.91MB/14.91MB

 ---> Using cache
 ---> 12e65362e94e
Step 4/8 : COPY extract_indexes.sh /opt/
 ---> Using cache
 ---> c9694e5a268a
Step 5/8 : WORKDIR /work/
 ---> Using cache
 ---> 525c41be817b
Step 6/8 : RUN ls /opt/
 ---> Using cache
 ---> 91b3eb5e16cc
Step 7/8 : RUN ls -R /work/
 ---> Using cache
 ---> 335f0f195859
Step 8/8 : CMD ["sh", "/opt/extract_indexes.sh"]
 ---> Using cache
 ---> aa1d2756a484
Successfully built aa1d2756a484
Successfully tagged softwareheritage/maven-index-exporter:20220329-161951
+ docker tag softwareheritage/maven-index-exporter:20220329-161951 softwareheritage/maven-index-exporter:20220329
+ docker tag softwareheritage/maven-index-exporter:20220329 softwareheritage/maven-index-exporter:latest
+ [[ -n ardumont ]]
+ [[ no = \y\e\s ]]
+ echo 'Done creating images.'
Done creating images.

Migrated from D7460 (view on Phabricator)

Merge request reports

Loading