Skip to content

Instantly share code, notes, and snippets.

@ailispaw
Last active October 14, 2015 01:15
Show Gist options
  • Save ailispaw/202618eb6e93a469c5be to your computer and use it in GitHub Desktop.
Save ailispaw/202618eb6e93a469c5be to your computer and use it in GitHub Desktop.
pottava/docker-webui with docker-alpine on docker-root
Vagrantfile
.vagrant/
FROM gliderlabs/alpine
RUN apk --update add curl git mercurial bzr go && \
rm -rf /var/cache/apk/*
ENV GOROOT /usr/lib/go
ENV GOPATH /gopath
ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin
RUN go get github.com/fsouza/go-dockerclient && \
go get golang.org/x/net/context
RUN go get -d github.com/pottava/docker-webui
WORKDIR ${GOPATH}/src/github.com/pottava/docker-webui
ENV CONFIG_FILE_PATH config.json
EXPOSE 9000
CMD ["go", "run", "main.go"]
Vagrant.configure(2) do |config|
config.vm.box = "ailispaw/docker-root"
config.vm.synced_folder ".", "/vagrant"
if Vagrant.has_plugin?("vagrant-triggers") then
config.trigger.after [:up, :resume] do
info "Adjusting datetime after suspend and resume."
run_remote "sudo sntp -4sSc pool.ntp.org; date"
end
end
# Adjusting datetime before provisioning.
config.vm.provision :shell, run: "always" do |sh|
sh.inline = "sntp -4sSc pool.ntp.org; date"
end
config.vm.provision :docker do |d|
d.build_image "/vagrant", args: "-t docker-webui"
d.run "ap",
image: "docker-webui",
args: "-p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock"
end
config.vm.network :forwarded_port, guest: 9000, host: 9000
end
@ailispaw
Copy link
Author

ailispaw commented Sep 7, 2015

$ vagrant up
$ open http://localhost:9000/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment