vagrant-docker-compose 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2094b1904e3f3ffc9fb8082535a07fd879ca225acd2675b10f34f2bd3be01c6
4
- data.tar.gz: 64fb9993e20906189927735d7d8a27d66d3a98a63910a4e4c2709322f121d155
3
+ metadata.gz: 6bc10cdbca67bacd396cc2944b0fe8bd40ed594125f22f40590f8c5681b759a4
4
+ data.tar.gz: 68a1c99f8cf0aa48f196cdc5f28b99e91ae4f926cdabaaaace4430533da36549
5
5
  SHA512:
6
- metadata.gz: dbb9e8572f25ebe7688817b34120ad9209ea853a65fa0967ee4f838d2cd3e692bacd952a41bc506dc7cc3d95b0515019793d00444942fb9664663361fd719d23
7
- data.tar.gz: ed6a09c25f4168c10767bb13904fa32e9e1caeedabf3ad8ed2b75fef5dad9237b9e9735432d2a91c470eb0def94a3511408308f9a8fe5133bb6ffbcd48fc4a59
6
+ metadata.gz: 64b35185ae5274fee4b55833c419a23397c242c5f6a830973192daa8ba2d737127887cca6b1548415f1d549d75aa66a29127bc8541ef44e8c2c5986d0212ead6
7
+ data.tar.gz: 2ac9c487cfc1c52423518c3831b864b87189710dd4f6e048d387576168b785ea91131075cd55c351c39e4d61895217ab27bd7e0288d8d9607df0b135efc8f25f
@@ -0,0 +1,59 @@
1
+ version: 2.1
2
+
3
+ executors:
4
+ ubuntu1404:
5
+ machine:
6
+ image: circleci/classic:latest
7
+ ubuntu1604:
8
+ machine:
9
+ image: ubuntu-1604:201903-01
10
+
11
+ commands:
12
+ docker_build_debian10:
13
+ steps:
14
+ - run: docker build -t vagrant:debian10 https://github.com/leighmcculloch/vagrant-docker-image.git#:debian10
15
+ - run: docker tag vagrant:debian10 vagrant:latest
16
+ docker_build_centos7:
17
+ steps:
18
+ - run: docker build -t vagrant:centos7 https://github.com/leighmcculloch/vagrant-docker-image.git#:centos7
19
+ - run: docker tag vagrant:centos7 vagrant:latest
20
+ test:
21
+ steps:
22
+ - run: bundle install --path vendor/bundle
23
+ - run: bundle exec vagrant up
24
+ - run: bundle exec vagrant ssh -c 'docker-compose --version'
25
+
26
+ jobs:
27
+ host_ubuntu1404_guest_debian10:
28
+ executor: ubuntu1404
29
+ steps:
30
+ - docker_build_debian10
31
+ - checkout
32
+ - test
33
+ host_ubuntu1404_guest_centos7:
34
+ executor: ubuntu1404
35
+ steps:
36
+ - docker_build_centos7
37
+ - checkout
38
+ - test
39
+ host_ubuntu1604_guest_debian10:
40
+ executor: ubuntu1604
41
+ steps:
42
+ - docker_build_debian10
43
+ - checkout
44
+ - test
45
+ host_ubuntu1604_guest_centos7:
46
+ executor: ubuntu1604
47
+ steps:
48
+ - docker_build_centos7
49
+ - checkout
50
+ - test
51
+
52
+ workflows:
53
+ version: 2
54
+ test:
55
+ jobs:
56
+ - host_ubuntu1404_guest_debian10
57
+ - host_ubuntu1404_guest_centos7
58
+ - host_ubuntu1604_guest_debian10
59
+ - host_ubuntu1604_guest_centos7
@@ -0,0 +1,18 @@
1
+ # Contributing Guidelines
2
+
3
+ Contributions are much appreciated and welcome!
4
+
5
+ ### How to Contribute
6
+
7
+ There are many ways you can contribute:
8
+
9
+ 1. Create an issue to share a bug you've discovered, or feature that is missing.
10
+
11
+ 2. Contribute to issue discussions to help identify what bugs and new features need implementing.
12
+
13
+ 3. Open a PR against an issue if you'd like to have a go at implementing it. Comment on the issue that you're going to take it on.
14
+
15
+ 4. Review PRs and test out other's changes.
16
+
17
+ 5. Comment on open PRs that you'd like to see in the next release.
18
+
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Vagrant Provisioner: Docker Compose
2
2
 
3
+ [![CircleCI](https://img.shields.io/circleci/build/github/leighmcculloch/vagrant-docker-compose?style=for-the-badge)](https://circleci.com/gh/leighmcculloch/vagrant-docker-compose/tree/master)
4
+
3
5
  A Vagrant provisioner for [Docker Compose](https://docs.docker.com/compose/). Installs Docker Compose and can also bring up the containers defined by a [docker-compose.yml](https://docs.docker.com/compose/yml/).
4
6
 
5
7
  ## Install
@@ -14,7 +16,7 @@ vagrant plugin install vagrant-docker-compose
14
16
 
15
17
  ```ruby
16
18
  Vagrant.configure("2") do |config|
17
- config.vm.box = "ubuntu/trusty64"
19
+ config.vm.box = "ubuntu/bionic64"
18
20
 
19
21
  config.vm.provision :docker
20
22
  config.vm.provision :docker_compose
@@ -25,7 +27,7 @@ end
25
27
 
26
28
  ```ruby
27
29
  Vagrant.configure("2") do |config|
28
- config.vm.box = "ubuntu/trusty64"
30
+ config.vm.box = "ubuntu/bionic64"
29
31
 
30
32
  config.vm.provision :docker
31
33
  config.vm.provision :docker_compose, yml: "/vagrant/docker-compose.yml", run: "always"
@@ -42,7 +44,7 @@ docker-compose -f [yml] up -d
42
44
 
43
45
  ```ruby
44
46
  Vagrant.configure("2") do |config|
45
- config.vm.box = "ubuntu/trusty64"
47
+ config.vm.box = "ubuntu/bionic64"
46
48
 
47
49
  config.vm.provision :docker
48
50
  config.vm.provision :docker_compose,
@@ -65,7 +67,7 @@ docker-compose -f [yml-0] -f [yml-1] ... up -d
65
67
 
66
68
  ```ruby
67
69
  Vagrant.configure("2") do |config|
68
- config.vm.box = "ubuntu/trusty64"
70
+ config.vm.box = "ubuntu/bionic64"
69
71
 
70
72
  config.vm.provision :docker
71
73
  config.vm.provision :docker_compose, yml: "/vagrant/docker-compose.yml", rebuild: true, run: "always"
@@ -84,7 +86,7 @@ docker-compose -f [yml] up -d
84
86
 
85
87
  ```ruby
86
88
  Vagrant.configure("2") do |config|
87
- config.vm.box = "ubuntu/trusty64"
89
+ config.vm.box = "ubuntu/bionic64"
88
90
 
89
91
  config.vm.provision :docker
90
92
  config.vm.provision :docker_compose, yml: "/vagrant/docker-compose.yml", rebuild: true,
@@ -2,41 +2,50 @@
2
2
  # vi: set ft=ruby :
3
3
 
4
4
  # ==============================================================================
5
- # This Vagrantfile is for testing the plugin. For an example of how to use the
6
- # plugin look at the Vagrantfile in the example directory.
5
+ #
6
+ # This Vagrantfile is for developing and testing the plugin. For an example of
7
+ # how to use the plugin look at the Vagrantfile in the example directory.
8
+ #
9
+ # ==============================================================================
7
10
  #
8
11
  # If you are developing or contributing to this plugin you can use this
9
- # Vagrantfile. It is designed to be run inside a Docker container that is
10
- # already on a network called 'devenv'. The Vagrantfile tells Vagrant to start
11
- # the machine on the 'devenv' network, and to give the container's name
12
- # 'vagrant'. While portforwarding to the host for SSH still takes place it is
13
- # ignored and Vagrant connects directly to the SSH port on the 'vagrant'
14
- # container.
12
+ # Vagrantfile. It supports being run automatically in two configurations:
13
+ #
14
+ # 1) Outside Docker, using Vagrant running on a host.
15
15
  #
16
- # Before using this file you'll want to run this command to install vagrant as
17
- # a gem:
18
- # bundle install
16
+ # 2) Inside a Docker container that has access to the Docker socket and attached
17
+ # to a network named 'devenv'. Run the following commands inside the Docker
18
+ # container.
19
19
  #
20
- # To start vagrant it is important to always use bundle exec:
21
- # bundle exec vagrant up
20
+ # In both configurations you can start it up with:
22
21
  #
23
- # To SSH into the container:
24
- # bundle exec vagrant ssh
22
+ # bundle install
23
+ # bundle exec vagrant up
25
24
  #
26
- # To delete the container when finished:
27
- # bundle exec vagrant destroy -f
25
+ # All vagrant commands need to be prefixed with 'bundle exec'.
28
26
  #
29
27
  # ==============================================================================
30
28
 
29
+ def inside_docker?
30
+ system("grep docker /proc/1/cgroup -qa")
31
+ end
32
+
31
33
  Vagrant.configure("2") do |config|
34
+ inside_docker = inside_docker?
35
+
32
36
  config.vm.provider :docker do |d|
33
37
  d.image = "vagrant" # https://github.com/leighmcculloch/vagrant-docker-image
34
38
  d.has_ssh = true
35
- d.create_args = ["--name=vagrant", "--network=devenv"]
39
+ d.create_args = [
40
+ "--name=vagrant",
41
+ ("--network=devenv" if inside_docker),
42
+ ].compact
36
43
  end
37
44
 
38
- config.ssh.host = "vagrant"
39
- config.ssh.port = 22
45
+ if inside_docker
46
+ config.ssh.host = "vagrant"
47
+ config.ssh.port = 22
48
+ end
40
49
 
41
50
  config.vm.provision :docker_compose, run: "always"
42
51
  end
@@ -8,7 +8,7 @@ unless Vagrant.has_plugin?("vagrant-docker-compose")
8
8
  end
9
9
 
10
10
  Vagrant.configure("2") do |config|
11
- config.vm.box = "ubuntu/trusty64"
11
+ config.vm.box = "ubuntu/bionic64"
12
12
 
13
13
  port = 9090
14
14
 
@@ -1,3 +1,25 @@
1
- FROM ubuntu:14.04
2
- WORKDIR /app
3
- CMD while true ; do nc -l 8080 < /app/index.html ; done
1
+ FROM ubuntu:bionic as builder
2
+
3
+ RUN apt-get update -y && \
4
+ apt-get install -y \
5
+ build-essential \
6
+ curl
7
+
8
+ RUN cd /tmp && \
9
+ curl -O http://download.redis.io/redis-stable.tar.gz && \
10
+ tar xvzf redis-stable.tar.gz && \
11
+ cd redis-stable && \
12
+ make && \
13
+ chmod 755 src/redis-cli
14
+
15
+ FROM ubuntu:bionic
16
+
17
+ # Install nc for web serving
18
+ RUN apt-get update -y && apt-get install -y netcat curl
19
+
20
+ # Install redis-cli
21
+ COPY --from=builder /tmp/redis-stable/src/redis-cli /usr/local/bin/
22
+
23
+ # Serve the date and a counter
24
+ EXPOSE 8080
25
+ CMD while true ; do nc -l -p 8080 -c 'echo "HTTP/1.1 200 OK\n\n$(date)\nVisit count: $(redis-cli -h redis incr visit_counter)"' ; done
@@ -18,10 +18,12 @@ module VagrantPlugins
18
18
  remote_tmp_path = nil
19
19
  Dir.mktmpdir do |local_tmp_dir|
20
20
  local_tmp_path = File.join(local_tmp_dir, "docker-compose")
21
- File.open(local_tmp_path, "w") do |f|
21
+ File.open(local_tmp_path, "wb") do |f|
22
22
  contents = fetch_file(url)
23
23
  f.write(contents)
24
24
  end
25
+ sig = Digest::SHA256.file(local_tmp_path).hexdigest
26
+ @machine.ui.detail(I18n.t(:downloaded_signature, version: @config.compose_version, signature: sig))
25
27
 
26
28
  @machine.ui.detail(I18n.t(:uploading, version: @config.compose_version))
27
29
  remote_tmp_path = @machine.guest.capability(:docker_compose_upload, @config, local_tmp_path)
@@ -6,6 +6,7 @@ en:
6
6
  checking_installation: Checking for Docker Compose installation...
7
7
  getting_info: Getting machine and kernel name from guest machine...
8
8
  downloading: Downloading Docker Compose %{version} for %{kernel} %{machine}
9
+ downloaded_signature: Downloaded Docker Compose %{version} has SHA256 signature %{signature}
9
10
  uploading: Uploading Docker Compose %{version} to guest machine...
10
11
  installing: Installing Docker Compose %{version} in guest machine...
11
12
  symlinking: Symlinking Docker Compose %{version} in guest machine...
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module DockerComposeProvisioner
3
- VERSION = "1.5.0"
3
+ VERSION = "1.5.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-docker-compose
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leigh McCulloch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-28 00:00:00.000000000 Z
11
+ date: 2019-10-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Vagrant provisioner for docker compose.
14
14
  email:
@@ -16,7 +16,9 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
+ - ".circleci/config.yml"
19
20
  - ".gitignore"
21
+ - CONTRIBUTING.md
20
22
  - Gemfile
21
23
  - LICENSE.md
22
24
  - README.md
@@ -24,8 +26,6 @@ files:
24
26
  - Vagrantfile
25
27
  - example/Vagrantfile
26
28
  - example/app/Dockerfile
27
- - example/app/index.html
28
- - example/app/init.sh
29
29
  - example/docker-compose-base.yml
30
30
  - example/docker-compose.yml
31
31
  - lib/vagrant-docker-compose.rb
@@ -1,9 +0,0 @@
1
- <html>
2
- <head>
3
- <title>An App</title>
4
- </head>
5
- <body>
6
- <h1>An App</h1>
7
- <p>An app that serves static.</p>
8
- </body>
9
- </html>
@@ -1 +0,0 @@
1
- while true ; do nc -l 8080 < /app/index.html ; done