beaker-docker 1.1.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -5
- data/docker.md +11 -2
- data/lib/beaker/hypervisor/docker.rb +7 -3
- data/lib/beaker-docker/version.rb +1 -1
- data/spec/beaker/hypervisor/docker_spec.rb +17 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60d4e4b389614a36d04d058e43e4ff3dccbd4b0902d1848f7131d2185a41f6db
|
4
|
+
data.tar.gz: 476e807dc221163733a9bb2524c2d5f371d32a884379f16b252825cd5ec44237
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d2b58be378b0837b800cf93fbacdc4ed1ebfb97451c3f0217ef3b9189eda1cdf3938e18706c3d1ccad831b9af2f089d517a77d20e09a91025bf4d07a52f5435
|
7
|
+
data.tar.gz: '080373c40a10808cd658bf585e2ab34768de2a3efc85e7a90180d694685c92e340c9746eae02674454e6a32b20dd314d66aa705b57e53984f521ee0e9db2470c'
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,23 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [1.
|
3
|
+
## [1.3.0](https://github.com/voxpupuli/beaker-docker/tree/1.3.0) (2022-12-18)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/1.2.0...1.3.0)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Generate a ssh port from 1025..9999 range [\#68](https://github.com/voxpupuli/beaker-docker/pull/68) ([jay7x](https://github.com/jay7x))
|
10
|
+
|
11
|
+
## [1.2.0](https://github.com/voxpupuli/beaker-docker/tree/1.2.0) (2022-08-11)
|
12
|
+
|
13
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/1.1.1...1.2.0)
|
14
|
+
|
15
|
+
**Implemented enhancements:**
|
16
|
+
|
17
|
+
- Use ssh-keygen -A on modern Enterprise Linux [\#66](https://github.com/voxpupuli/beaker-docker/pull/66) ([ekohl](https://github.com/ekohl))
|
18
|
+
- Add Docker hostfile parameter docker\_image\_first\_commands [\#65](https://github.com/voxpupuli/beaker-docker/pull/65) ([Rathios](https://github.com/Rathios))
|
19
|
+
|
20
|
+
## [1.1.1](https://github.com/voxpupuli/beaker-docker/tree/1.1.1) (2022-02-17)
|
4
21
|
|
5
22
|
[Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/1.1.0...1.1.1)
|
6
23
|
|
@@ -21,10 +38,6 @@
|
|
21
38
|
|
22
39
|
- Use host\_packages helper to reuse logic from beaker [\#59](https://github.com/voxpupuli/beaker-docker/pull/59) ([ekohl](https://github.com/ekohl))
|
23
40
|
|
24
|
-
**Merged pull requests:**
|
25
|
-
|
26
|
-
- Release 1.1.0 [\#60](https://github.com/voxpupuli/beaker-docker/pull/60) ([ekohl](https://github.com/ekohl))
|
27
|
-
|
28
41
|
## [1.0.1](https://github.com/voxpupuli/beaker-docker/tree/1.0.1) (2021-09-13)
|
29
42
|
|
30
43
|
[Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/1.0.0...1.0.1)
|
data/docker.md
CHANGED
@@ -23,13 +23,22 @@ The base image to use for the container is named by the image key.
|
|
23
23
|
type: foss
|
24
24
|
|
25
25
|
### Docker hosts file, with image modification ###
|
26
|
-
You can specify extra commands to be executed in order to modify the image with the `docker_image_commands`
|
26
|
+
You can specify extra commands to be executed in order to modify the image with the keys `docker_image_commands` and
|
27
|
+
`docker_image_first_commands`.
|
28
|
+
|
29
|
+
`docker_image_commands` is executed after initial setup. `docker_image_first_commands` is executed before any other
|
30
|
+
commands and can be used eg. to configure a proxy.
|
27
31
|
|
28
32
|
HOSTS:
|
29
33
|
ubuntu-12-10:
|
30
34
|
platform: ubuntu-12.10-x64
|
31
35
|
image: ubuntu:12.10
|
32
36
|
hypervisor: docker
|
37
|
+
docker_image_first_commands:
|
38
|
+
- echo 'Acquire::http::Proxy "http://proxy.example.com:3128";'> /etc/apt/apt.conf.d/01proxy
|
39
|
+
- echo "export http_proxy=http://proxy.example.com:3128"> /etc/profile.d/proxy.sh
|
40
|
+
- echo "export https_proxy=http://proxy.example.com:3128">> /etc/profile.d/proxy.sh
|
41
|
+
- echo "export no_proxy=127.0.0.1,::1">> /etc/profile.d/proxy.sh
|
33
42
|
docker_image_commands:
|
34
43
|
- 'apt-get install -y myapp'
|
35
44
|
- 'myapp --setup'
|
@@ -53,7 +62,7 @@ Instead of using ssh as the CMD for a container, beaker will use the entrypoint
|
|
53
62
|
|
54
63
|
HOSTS:
|
55
64
|
puppetserver:
|
56
|
-
platform: ubuntu-1604-x86_64
|
65
|
+
platform: ubuntu-1604-x86_64
|
57
66
|
hypervisor: docker
|
58
67
|
image: puppet/puppetserver-standalone:6.0.1
|
59
68
|
use_image_entry_point: true
|
@@ -78,7 +78,7 @@ module Beaker
|
|
78
78
|
'Hostname' => host.name,
|
79
79
|
'HostConfig' => {
|
80
80
|
'PortBindings' => {
|
81
|
-
'22/tcp' => [{ 'HostPort' => rand.to_s
|
81
|
+
'22/tcp' => [{ 'HostPort' => rand(1025..9999).to_s, 'HostIp' => '0.0.0.0'}]
|
82
82
|
},
|
83
83
|
'PublishAllPorts' => true,
|
84
84
|
'RestartPolicy' => {
|
@@ -401,8 +401,7 @@ module Beaker
|
|
401
401
|
when /el-[89]/, /fedora-(2[2-9]|3[0-9])/
|
402
402
|
container.exec(%w(dnf clean all))
|
403
403
|
container.exec(%w(dnf install -y sudo openssh-server openssh-clients))
|
404
|
-
container.exec(%w(ssh-keygen -
|
405
|
-
container.exec(%w(ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key))
|
404
|
+
container.exec(%w(ssh-keygen -A))
|
406
405
|
container.exec(%w(sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/*))
|
407
406
|
when /^el-/, /centos/, /fedora/, /redhat/, /eos/
|
408
407
|
container.exec(%w(yum clean all))
|
@@ -516,6 +515,11 @@ module Beaker
|
|
516
515
|
ENV container docker
|
517
516
|
EOF
|
518
517
|
|
518
|
+
# Commands before any other commands. Can be used for eg. proxy configuration
|
519
|
+
dockerfile += (host['docker_image_first_commands'] || []).map { |command|
|
520
|
+
"RUN #{command}\n"
|
521
|
+
}.join('')
|
522
|
+
|
519
523
|
# additional options to specify to the sshd
|
520
524
|
# may vary by platform
|
521
525
|
sshd_options = ''
|
@@ -692,6 +692,23 @@ module Beaker
|
|
692
692
|
end
|
693
693
|
end
|
694
694
|
|
695
|
+
it 'should add docker_image_first_commands as RUN statements' do
|
696
|
+
FakeFS.deactivate!
|
697
|
+
platforms.each do |platform|
|
698
|
+
dockerfile = docker.send(:dockerfile_for, {
|
699
|
+
'platform' => platform,
|
700
|
+
'image' => 'foobar',
|
701
|
+
'docker_image_first_commands' => [
|
702
|
+
'special one',
|
703
|
+
'special two',
|
704
|
+
'special three',
|
705
|
+
]
|
706
|
+
})
|
707
|
+
|
708
|
+
expect( dockerfile ).to be =~ /RUN special one\nRUN special two\nRUN special three/
|
709
|
+
end
|
710
|
+
end
|
711
|
+
|
695
712
|
it 'should add docker_image_commands as RUN statements' do
|
696
713
|
FakeFS.deactivate!
|
697
714
|
platforms.each do |platform|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker-docker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2022-
|
14
|
+
date: 2022-12-18 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
|
-
rubygems_version: 3.2.
|
161
|
+
rubygems_version: 3.2.33
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: Beaker DSL Extension Helpers!
|