This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 797
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker registry): add Vagrantfile for Docker registry
Adds a contrib/docker-registry directory with a Vagrantfile that configures and starts a VM with the Docker registry service.
- Loading branch information
1 parent
82c2a0d
commit 7199d88
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Private Docker registry | ||
======================= | ||
|
||
This directory provides a Vagrantfile and user-data file to provision and configure a CoreOS machine | ||
which runs a private Docker registry. This is useful for testing Deis because it is significantly | ||
faster than the public Docker registry. | ||
|
||
To run the registry, in this directory simply: | ||
```console | ||
$ vagrant up | ||
``` | ||
|
||
The registry will then be accessible at `172.21.12.100:5000` from any other local VM, including | ||
Deis machines. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# -*- mode: ruby -*- | ||
# # vi: set ft=ruby : | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.box = "coreos-alpha" | ||
config.vm.box_url = "http://alpha.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json" | ||
|
||
config.vm.provider :vmware_fusion do |vb, override| | ||
override.vm.box_url = "http://alpha.release.core-os.net/amd64-usr/current/coreos_production_vagrant_vmware_fusion.json" | ||
end | ||
|
||
config.vm.provider :virtualbox do |vb, override| | ||
# Fix docker not being able to resolve private registry in VirtualBox | ||
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | ||
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"] | ||
end | ||
|
||
config.vm.provider :virtualbox do |v| | ||
# On VirtualBox, we don't have guest additions or a functional vboxsf | ||
# in CoreOS, so tell Vagrant that so it can be smarter. | ||
v.check_guest_additions = false | ||
end | ||
|
||
# plugin conflict | ||
if Vagrant.has_plugin?("vagrant-vbguest") then | ||
config.vbguest.auto_update = false | ||
end | ||
|
||
config.vm.define vm_name = 'docker-registry' do |config| | ||
config.vm.hostname = 'docker-registry' | ||
config.vm.network :private_network, ip: "172.21.12.100" | ||
|
||
# user-data bootstrapping | ||
config.vm.provision :file, :source => "user-data", :destination => "/tmp/vagrantfile-user-data" | ||
config.vm.provision :shell, :inline => "mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", :privileged => true | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#cloud-config | ||
--- | ||
coreos: | ||
units: | ||
- name: docker-registry.service | ||
command: start | ||
content: | | ||
[Unit] | ||
Description=Docker Registry server | ||
|
||
[Service] | ||
ExecStartPre=/bin/sh -c "docker history registry:latest >/dev/null || docker pull registry:latest" | ||
ExecStart=/usr/bin/docker run --name docker-registry -e STORAGE_PATH=/registry -e SEARCH_BACKEND=sqlalchemy -p 5000:5000 registry:latest |