Skip to content

Instantly share code, notes, and snippets.

@jwo

jwo/Dockerfile

Created Oct 26, 2017
Embed
What would you like to do?
Node app which uses dockerode to run a simple test suite against a Git Repo.
git clone $1 /tmp/app
cd /tmp/app
git checkout $2
write-good *.md
FROM node:8
RUN npm install -g write-good
ADD clone-run.sh /tmp/clone-run.sh
console.log("Just Playing Along")
var Docker = require("dockerode")
var docker = new Docker({ socketPath: "/var/run/docker.sock" })
console.log("Started")
docker
.run(
"4d55c12364a5", // in the `images` folder, run `docker build .` and get the container ID
["bash", "/tmp/clone-run.sh", "https://github.com/jwo/react-hover-image", "SHA-or-REF"],
process.stdout
)
.then(function(container) {
return container.remove()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment