mirror of
https://github.com/Telecominfraproject/ols-nos.git
synced 2025-11-01 02:27:58 +00:00
Recover "Support SONiC Reproduceable Build-debian/pip/web packages (#6255)
* Revert "Revert "Support SONiC Reproduceable Build-debian/pip/web packages (#5718)"" This reverts commit17497a65e3. * Revert "Revert "Remove unnecessary sudo authority in build Makefile (#6237)"" This reverts commit163b7111b5.
This commit is contained in:
25
scripts/collect_docker_version_files.sh
Executable file
25
scripts/collect_docker_version_files.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
DOCKER_IMAGE=$1
|
||||
TARGET_PATH=$2
|
||||
|
||||
[ -z "$TARGET_PATH" ] && TARGET_PATH=./target
|
||||
|
||||
DOCKER_IMAGE_NAME=$(echo $DOCKER_IMAGE | cut -d: -f1)
|
||||
DOCKER_CONTAINER=$DOCKER_IMAGE_NAME
|
||||
TARGET_VERSIONS_PATH=$TARGET_PATH/versions/dockers/$DOCKER_IMAGE_NAME
|
||||
|
||||
[ -d $TARGET_VERSIONS_PATH ] && rm -rf $TARGET_VERSIONS_PATH
|
||||
mkdir -p $TARGET_VERSIONS_PATH
|
||||
|
||||
export DOCKER_CLI_EXPERIMENTAL=enabled
|
||||
|
||||
# Remove the old docker container if existing
|
||||
if docker container inspect $DOCKER_IMAGE > /dev/null 2>&1; then
|
||||
docker container rm $DOCKER_IMAGE > /dev/null
|
||||
fi
|
||||
docker create --name $DOCKER_CONTAINER --entrypoint /bin/bash $DOCKER_IMAGE
|
||||
docker cp -L $DOCKER_CONTAINER:/etc/os-release $TARGET_VERSIONS_PATH/
|
||||
docker cp -L $DOCKER_CONTAINER:/usr/local/share/buildinfo/pre-versions $TARGET_VERSIONS_PATH/
|
||||
docker cp -L $DOCKER_CONTAINER:/usr/local/share/buildinfo/post-versions $TARGET_VERSIONS_PATH/
|
||||
docker container rm $DOCKER_CONTAINER
|
||||
Reference in New Issue
Block a user