Skip to content

Instantly share code, notes, and snippets.

@MatteoRagni
Created March 30, 2017 08:27
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 MatteoRagni/861a46589c6a45a8d325522046cb4db9 to your computer and use it in GitHub Desktop.
Save MatteoRagni/861a46589c6a45a8d325522046cb4db9 to your computer and use it in GitHub Desktop.
VBOX building environment
FROM debian:7.11
LABEL Description "Building Machine for VBox"
LABEL Vendor "Matteo Ragni, Alessandro Mazzalai"
LABEL Mantainer "info@ragni.me"
LABEL Version "1.0"
RUN apt-get update
RUN apt-get install -y --no-upgrade --no-install-recommends \
build-essential \
clang \
cmake \
ruby
RUN mkdir /src
WORKDIR /src
CMD /bin/bash
#!/bin/bash
__vboxenvstart__() {
docker run --name vbox-env-machine -d -v $(pwd):/src matteoragni/vbox-env tail -f /dev/null
}
__vboxenvstop__() {
docker rm $(docker stop $(docker ps -a -q --filter ancestor=<vbox-env-machine> --format="{{.ID}}"))
}
__vboxenvrun__() {
echo "runs: $@"
docker run -it -v $(pwd):/src matteoragni/vbox-env bash -c "$@"
}
__vboxenvexec__() {
docker exec -it vbox-env-machine bash -c "$@"
}
vboxenv() {
case $1 in
help)
echo "VBOX ENVIRONMENT"
echo " vboxenv help: shows this help"
echo " vboxenv start: starts the docker container"
echo " vboxenv stop: stops and remove the docker container"
echo " vboxenv exec ...: commands are passed directly to the container. Must be started first."
echo " vboxenv ...: starts, runs and stops commands."
;;
start)
__vboxenvstart__
;;
stop)
__vboxenvstop__
;;
exec)
__vboxenvexec__ "$@"
;;
*)
__vboxenvrun__ "$@"
;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment