Skip to content

Instantly share code, notes, and snippets.

@kumarrishav
Created March 8, 2019 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumarrishav/36596fc94fe282d9e8dc26707fbdb7df to your computer and use it in GitHub Desktop.
Save kumarrishav/36596fc94fe282d9e8dc26707fbdb7df to your computer and use it in GitHub Desktop.
Medium Blog: Leveraging Docker Multi-Stage Builds to optimize Dockerfile/Image
const https = require('https');
https.get('https://api.nasa.gov/planetary/apod?api_key=<api_key>', (resp) => {
let data = '';
// A chunk of data has been recieved.
resp.on('data', (chunk) => {
data += chunk;
});
// The whole response has been received. Print out the result.
resp.on('end', () => {
console.log(JSON.parse(data));
});
}).on("error", (err) => {
console.log("Error: " + err.message);
});
{
"name": "test-multistage",
"version": "1.0.0",
"description": "sample binary to show multistage",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"pkg": {
"scripts": "index.js"
},
"keywords": [
"sample",
"code"
],
"author": "kumarrishav",
"license": "ISC"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment