-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manifest #17
base: master
Are you sure you want to change the base?
Manifest #17
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules | ||
.idea | ||
.vscode | ||
*.iml | ||
openjdk-6 | ||
openjdk-7 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
COPY qemu-aarch64-static /usr/bin/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
docker push docker.io/p31amd64/fish-pepper-java-openjdk7-jdk-amd64:1.7-2 | ||
docker push docker.io/p31arm64v8/fish-pepper-java-openjdk7-jdk-arm64v8:1.7-2 | ||
docker push docker.io/p31amd64/fish-pepper-java-openjdk7-jre-amd64:1.7-2 | ||
docker push docker.io/p31arm64v8/fish-pepper-java-openjdk7-jre-arm64v8:1.7-2 | ||
docker push docker.io/p31amd64/fish-pepper-java-openjdk8-jdk-amd64:1.8-2 | ||
docker push docker.io/p31arm64v8/fish-pepper-java-openjdk8-jdk-arm64v8:1.8-2 | ||
docker push docker.io/p31amd64/fish-pepper-java-openjdk8-jre-amd64:1.8-2 | ||
docker push docker.io/p31arm64v8/fish-pepper-java-openjdk8-jre-arm64v8:1.8-2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
var imageNames = require('./image-names'); | ||
var child = require('child_process'); | ||
var stream = require('stream'); | ||
const fs = require('fs'); | ||
var readline = require('readline'); | ||
|
||
exports.build = function(root, docker, types, allParamValues, image, opts) { | ||
doBuildManifests(root, docker, imageNames.createImageNames(image, types, allParamValues),opts); | ||
}; | ||
|
||
function doBuildManifests(root, docker, imageNames, opts) { | ||
//for now we only support amd64 and arm64v8 | ||
var arch = ['arm64v8']; | ||
var anno = [' --os linux --arch arm64 --variant armv8']; | ||
if (imageNames && imageNames.length > 0) { | ||
|
||
var imageName = imageNames.shift(); | ||
var shortName = imageName.getShortName(); | ||
console.log(" " + imageName.getLabel().green + " --> " + imageName.getImageNameWithVersion().cyan); | ||
|
||
var manifest = 'docker manifest create ' + imageName.getImageNameWithVersion(); | ||
var archImageNames = findImagesInFile(shortName); | ||
for (var i in archImageNames) { | ||
manifest = manifest + ' ' + archImageNames[i]; | ||
} | ||
manifest = manifest + '\n'; | ||
|
||
for (var i in arch) { | ||
for (var j in archImageNames) { | ||
if (archImageNames[j].includes(arch[i])) { | ||
var annotation = 'docker manifest annotate ' + imageName.getImageNameWithVersion(); | ||
annotation = annotation + ' ' + archImageNames[j] + anno[i]; | ||
manifest = manifest + annotation + '\n'; | ||
} | ||
} | ||
} | ||
manifest = manifest + 'docker manifest push ' + imageName.getImageNameWithVersion() + '\n\n'; | ||
writeStream = fs.createWriteStream('manifest.log', {flags: 'a'}); | ||
writeStream.write(manifest); | ||
writeStream.end(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what happens with the manifest except than get written to a log file ? |
||
|
||
doBuildManifests(root, docker, imageNames, opts); | ||
} | ||
|
||
} | ||
|
||
function findImagesInFile(arch) { | ||
var lines = fs.readFileSync('push-images.log', 'utf-8') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wouldn't it be better to pick the image names from the configuration than from a log file which adds some dependencies on your the user's usage flow ? Looking up the config like 'build' does shouldn't be that hard here, too. |
||
.split('\n') | ||
.filter(function (line) { | ||
return line.includes(arch); | ||
}); | ||
var names = []; | ||
for (var i in lines) { | ||
names.push(lines[i].substring(12)); | ||
} | ||
return names; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every parameter which has a meaning for fish-pepper should go below the fish-pepper configuration section. Everything else can be introduced and changed by the user freely. So that kind of dockerOrg should not into this section where the user has the full control of all parameter keys.