kitchen-docker 2.13.0 → 2.14.0

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: 8b1291ba7bef7b5a17771a1187a34829acac0b0a78e4185119ecb0e5e23728da
4
- data.tar.gz: f1f3b39dc87295717756beab914c0ea5d945c68e318f581717e55b6a65ffbaea
3
+ metadata.gz: 5d65a3c6ae8fbb16e1fd87e4553a177ccaebc45fbaef3e92e0126b3fc46c2634
4
+ data.tar.gz: cf847bf5d538fdd037fdd8c446cd9242b29504c413a4a3be502e24b76b14ef60
5
5
  SHA512:
6
- metadata.gz: f6bcc821a798f066815e2b9da4ef82389b29e53da4dd66bfbb0a228cb2a9b185289621f496d60bea06c5fb54aab388201f4f0c287e4743d2bd809bce4ed264ff
7
- data.tar.gz: 6bdc6f960565040e5f8161dd6f64d81059fb9d83c42bf71287cf95c6e31ab50056f8e1ce5d065b1be53008bd79195bd93d36a1e661a0de297ac816676eae85f2
6
+ metadata.gz: 93d76bf32eaee907b3e284b5dafc2c7e85a2198c2626078b5ba6f85d922157fdbefd3a0d5cfdeaa01bdcd181bee16d1c7fc9ef5ea286fd2624b0c4573703bdb5
7
+ data.tar.gz: f3a4428581c76cf40eecbce6ecda3a207d72f0dff17788b6f9f0059bad59660955fe2cfe0ac4ffed5b1b933967c044e2889a52d9c8aeb50fa6480077c003c4cf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Kitchen-Docker Changelog
2
2
 
3
+ ## 2.14.0 - November 13, 2023
4
+
5
+ - Make sure the /etc/sudoers.d directory exists by @garethgreenaway in [#397](https://github.com/test-kitchen/kitchen-docker/pull/397)
6
+ - Breaking almalinux platform out by @garethgreenaway [#398](https://github.com/test-kitchen/kitchen-docker/pull/398)
7
+ - fix: parse_image_id: Process "docker build" output in reverse line order by @terminalmage in [#400](https://github.com/test-kitchen/kitchen-docker/pull/400)
8
+ - Allow build temporary Dockerfile in configured custom_dir by @Val in [294](https://github.com/test-kitchen/kitchen-docker/pull/294)
9
+
3
10
  ## 2.13.0 - June 10, 2022
4
11
 
5
12
  - Added CentOSStream and PhotonOS - [@garethgreenaway](https://github.com/garethgreenaway)
data/README.md CHANGED
@@ -583,6 +583,16 @@ Examples:
583
583
  net: br3
584
584
  ```
585
585
 
586
+ ### build_tempdir
587
+
588
+ Relative (to `build_context`) temporary directory path for built Dockerfile.
589
+
590
+ Example:
591
+
592
+ ```yaml
593
+ build_tempdir: .kitchen
594
+ ```
595
+
586
596
  ### use_internal_docker_network
587
597
 
588
598
  If you want to use kitchen-docker from within another Docker container you'll
@@ -16,6 +16,6 @@
16
16
  module Kitchen
17
17
  module Docker
18
18
  # Version string for Docker Kitchen driver
19
- DOCKER_VERSION = "2.13.0"
19
+ DOCKER_VERSION = "2.14.0"
20
20
  end
21
21
  end
@@ -34,10 +34,12 @@ module Kitchen
34
34
  gentoo_paludis_platform
35
35
  when 'opensuse/tumbleweed', 'opensuse/leap', 'opensuse', 'sles'
36
36
  opensuse_platform
37
- when 'rhel', 'centos', 'oraclelinux', 'amazonlinux', 'almalinux', 'rockylinux'
37
+ when 'rhel', 'centos', 'oraclelinux', 'amazonlinux', 'rockylinux'
38
38
  rhel_platform
39
39
  when 'centosstream'
40
40
  centosstream_platform
41
+ when 'almalinux'
42
+ almalinux_platform
41
43
  when 'photon'
42
44
  photonos_platform
43
45
  else
@@ -128,6 +130,16 @@ module Kitchen
128
130
  CODE
129
131
  end
130
132
 
133
+ def almalinux_platform
134
+ <<-CODE
135
+ ENV container docker
136
+ RUN yum clean all
137
+ RUN yum install -y sudo openssh-server openssh-clients which
138
+ RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
139
+ RUN [ -f "/etc/ssh/ssh_host_dsa_key" ] || ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
140
+ CODE
141
+ end
142
+
131
143
  def photonos_platform
132
144
  <<-CODE
133
145
  ENV container docker
@@ -143,6 +155,8 @@ module Kitchen
143
155
  RUN if ! getent passwd #{username}; then \
144
156
  useradd -d #{homedir} -m -s /bin/bash -p '*' #{username}; \
145
157
  fi
158
+ RUN mkdir -p /etc/sudoers.d
159
+ RUN chmod 0750 /etc/sudoers.d
146
160
  RUN echo "#{username} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/#{username}
147
161
  RUN echo "Defaults !requiretty" >> /etc/sudoers.d/#{username}
148
162
  RUN mkdir -p #{homedir}/.ssh
@@ -13,6 +13,7 @@
13
13
 
14
14
  require 'kitchen'
15
15
  require 'kitchen/configurable'
16
+ require 'pathname'
16
17
  require_relative 'cli_helper'
17
18
  require_relative 'container_helper'
18
19
 
@@ -25,7 +26,7 @@ module Kitchen
25
26
  include Kitchen::Docker::Helpers::ContainerHelper
26
27
 
27
28
  def parse_image_id(output)
28
- output.each_line do |line|
29
+ output.split("\n").reverse_each do |line|
29
30
  if line =~ /writing image (sha256:[[:xdigit:]]{64})(?: \d*\.\ds)? done/i
30
31
  img_id = line[/writing image (sha256:[[:xdigit:]]{64})(?: \d*\.\ds)? done/i,1]
31
32
  return img_id
@@ -50,7 +51,7 @@ module Kitchen
50
51
  extra_build_options = config_to_options(config[:build_options])
51
52
  cmd << " #{extra_build_options}" unless extra_build_options.empty?
52
53
  dockerfile_contents = dockerfile
53
- file = Tempfile.new('Dockerfile-kitchen', Dir.pwd)
54
+ file = Tempfile.new('Dockerfile-kitchen', Pathname.pwd + config[:build_tempdir])
54
55
  cmd << " -f #{Shellwords.escape(dockerfile_path(file))}" if config[:build_context]
55
56
  build_context = config[:build_context] ? '.' : '-'
56
57
  output = begin
@@ -37,6 +37,7 @@ module Kitchen
37
37
 
38
38
  default_config :binary, 'docker'
39
39
  default_config :build_options, nil
40
+ default_config :build_tempdir, Dir.pwd
40
41
  default_config :cap_add, nil
41
42
  default_config :cap_drop, nil
42
43
  default_config :disable_upstart, true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.0
4
+ version: 2.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-14 00:00:00.000000000 Z
11
+ date: 2023-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  - !ruby/object:Gem::Version
267
267
  version: '0'
268
268
  requirements: []
269
- rubygems_version: 3.2.3
269
+ rubygems_version: 3.4.10
270
270
  signing_key:
271
271
  specification_version: 4
272
272
  summary: A Docker Driver for Test Kitchen