
Security News
Static vs. Runtime Reachability: Insights from Latio’s On the Record Podcast
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
build-docker-image-from-tarball
Advanced tools
Take a path to a tarball image and build that tarball into a docker image
Module that takes a path to a git archive tarball and uses heroku-style buildpackg to build the repo into a docker image.
You will need the following installed. To get started you can use the supplied vagrant file which automatically installs docker and node.js on startup
The docker daemon must be installed and running. Visit https://docker.io for instructions on installing docker
A valid buildstep base docker image must be available in the list of docker images. There is an image available in the public docker index that will work if you do not wish to build your own
docker pull nisaacson/buildstep
# optionally tag this image with your own name
# docker tag nisaacson/buildstep foo_buildstep
npm install -S build-docker-image-from-tarball
Specfiy the following
sourcePath: /path/to/git/archive.tar.gz
buildImageName: buildstep
base image that containers the builder script and heroku buildpacksrepo
foo
the name of the image that will be built and appear in docker images
once the build completesvar buildFromTarball = require('build-from-tarball')
var data = {
sourcePath: '/path/to/git/archive.tar.gz',
buildImage: 'foo_buildstep',
destImageName: 'foo_app'
}
buildFromTarball(data, function(err) {
if (err) {
console.dir('failed to build docker image from git archive tarball', err)
return
}
console.log('image built correctly. You should now see the image %s when you execute `docker images`', data.destImageName)
})
Since the build progress is quite long, you may wish to monitor the progress of the build as it progresses. To monitor the progress, the builder is an instance of EventEmitter
that emits log events instead of spamming stdout.
var Builder = require('build-from-tarball')
var data = {
sourcePath: '/path/to/git/archive.tar.gz',
buildImage: 'foo_buildstep',
repo: 'foo_app'
}
var builder = new Builder()
// emit log events to avoid spamming stdout
builder.on('log', function(log) {
console.dir(log)
})
builder.build(data, completeHandler)
# create the default VM
vagrant up
# log into the VM via ssh
vagrant ssh
# navigate to the repo root directory
cd /vagrant
# install development dependencies
npm install
# run the tests
npm test
FAQs
Take a path to a tarball image and build that tarball into a docker image
The npm package build-docker-image-from-tarball receives a total of 1 weekly downloads. As such, build-docker-image-from-tarball popularity was classified as not popular.
We found that build-docker-image-from-tarball demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.