Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
easy-cozy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
POCS
cozy
easy-cozy
Commits
d3f39df7
Unverified
Commit
d3f39df7
authored
6 years ago
by
Vincent Sellier
Browse files
Options
Downloads
Patches
Plain Diff
Script docker's multiplatform manifest creation
parent
3938a91c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build/create-docker-manifest.sh
+72
-0
72 additions, 0 deletions
build/create-docker-manifest.sh
with
72 additions
and
0 deletions
build/create-docker-manifest.sh
0 → 100755
+
72
−
0
View file @
d3f39df7
#!/usr/bin/env bash
set
-eu
SCRIPT_DIR
=
"
$(
dirname
$0
)
"
IMAGE
=
vsellier/easy-cozy
VERSION
=
latest
function
usage
()
{
echo
"
$0
[-v <version>] [-p] [-h]"
echo
"-v <version> : Specify the version to build default: latest"
echo
"-s <suffix> : Specify a suffix to add to the version name <version>_<suffix>"
echo
"-p : Push the image to docker hub"
echo
"-h : display this help"
}
while
getopts
"v:phs:"
opt
;
do
case
$opt
in
v
)
VERSION
=
${
OPTARG
}
;;
s
)
VERSION_SUFFIX
=
${
OPTARG
}
;;
p
)
PUSH
=
true
;;
h
)
usage
exit
1
;;
esac
done
IMAGE_NAME
=
"
${
IMAGE
}
:
${
VERSION
}
"
ARM_IMAGE_NAME
=
"
${
IMAGE
}
:
${
VERSION
}
-arm"
AMD64_IMAGE_NAME
=
"
${
IMAGE
}
:
${
VERSION
}
-amd64"
if
[
-n
"
${
VERSION_SUFFIX
:-}
"
]
;
then
IMAGE_NAME
=
"
${
IMAGE_NAME
}
_
${
VERSION_SUFFIX
}
"
ARM_IMAGE_NAME
=
"
${
ARM_IMAGE_NAME
}
_
${
VERSION_SUFFIX
}
"
AMD64_IMAGE_NAME
=
"
${
AMD64_IMAGE_NAME
}
_
${
VERSION_SUFFIX
}
"
fi
echo
"Creating manifest for image
${
IMAGE_NAME
}
composed by
${
AMD64_IMAGE_NAME
}
and
${
ARM_IMAGE_NAME
}
"
echo
"Press enter to continue ..."
read
echo
"Creation in progress ..."
docker manifest create
${
IMAGE_NAME
}
${
AMD64_IMAGE_NAME
}
${
ARM_IMAGE_NAME
}
if
[
$?
-ne
0
]
;
then
echo
"Error create the manifest"
exit
1
fi
echo
"Manifest for
${
IMAGE_NAME
}
created :"
echo
"--------------------------------------"
docker manifest inspect
${
IMAGE_NAME
}
echo
"--------------------------------------"
echo
"Press enter to continue ..."
read
echo
"Pushing the manifest ..."
docker manifest push
${
IMAGE_NAME
}
if
[
$?
-ne
0
]
;
then
echo
"Error pushing the manifest"
exit
1
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment