Skip to content

Commit 9f94981

Browse files
committed
Add pod man documentation
Closes #255 Signed-off-by: Dan Webb <dan.webb@damacus.io>
1 parent 00f0ba2 commit 9f94981

File tree

2 files changed

+72
-16
lines changed

2 files changed

+72
-16
lines changed

README.md

+20-16
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,32 @@ suites:
4848
- recipe[hello_dokken::default]
4949
```
5050
51+
## Podman usage
52+
53+
For specific podman guidance please see [the podman documentation](documentation/PODMAN.md).
54+
5155
## How it works
5256
5357
### Primordial State
5458
5559
#### List kitchen suites
5660
5761
```shell
58-
laptop:~/src/chef-cookbooks/hello_dokken$ kitchen list
62+
$ kitchen list
5963
Instance Driver Provisioner Verifier Transport Last Action Last Error
6064
```
6165

6266
#### List containers
6367

6468
```shell
65-
laptop:~/src/chef-cookbooks/hello_dokken$ docker ps -a
69+
$ docker ps -a
6670
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6771
```
6872

6973
#### List images
7074

7175
```shell
72-
laptop:~/src/chef-cookbooks/hello_dokken$ docker images
76+
$ docker images
7377
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
7478
```
7579

@@ -78,7 +82,7 @@ REPOSITORY TAG IMAGE ID CREATED
7882
#### kitchen create
7983

8084
```shell
81-
laptop:~/src/chef-cookbooks/hello_dokken$ kitchen create
85+
$ kitchen create
8286
-----> Starting Kitchen (v1.15.0)
8387
-----> Creating <default-centos-7>...
8488
Creating local sandbox at /Users/someara/.dokken/sandbox/6e1b03ab46-default-centos-7
@@ -100,7 +104,7 @@ Finally, the driver pulls the image specified by the suite's platform section an
100104
#### List containers
101105

102106
```shell
103-
laptop:~/src/chef-cookbooks/hello_dokken$ docker ps -a
107+
$ docker ps -a
104108
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
105109
3489588d4470 6e1b03ab46-default-centos-7:latest "sh -c 'trap exit ..." About a minute ago Up About a minute 6e1b03ab46-default-centos-7
106110
f678882b1575 chef/chef:current "true" About a minute ago Created chef-current
@@ -109,7 +113,7 @@ f678882b1575 chef/chef:current "true"
109113
#### List images
110114

111115
```shell
112-
laptop:~/src/chef-cookbooks/hello_dokken$ docker images
116+
$ docker images
113117
REPOSITORY TAG IMAGE ID CREATED SIZE
114118
6e1b03ab46-default-centos-7 latest 2ea1040b9c10 About a minute ago 192 MB
115119
chef/chef current 01ec788610e2 6 days ago 124 MB
@@ -121,7 +125,7 @@ centos 7 67591570dd29 7 weeks ag
121125
#### kitchen converge
122126

123127
```shell
124-
laptop:~/src/chef-cookbooks/hello_dokken$ time kitchen converge
128+
$ time kitchen converge
125129
-----> Starting Kitchen (v1.15.0)
126130
-----> Converging <default-centos-7>...
127131
Creating local sandbox in /Users/someara/.dokken/sandbox/6e1b03ab46-default-centos-7
@@ -166,7 +170,7 @@ The `kitchen-converge` phase of the kitchen run uses the provisioner to upload c
166170
#### List containers
167171

168172
```shell
169-
laptop:~/src/chef-cookbooks/hello_dokken$ docker ps -a
173+
$ docker ps -a
170174
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
171175
c153dfd8e53d e9fa5d3a0d0e "sh -c 'trap exit 0 S" 9 minutes ago Up 9 minutes default-centos-7
172176
32c42fba4a8c someara/kitchen-cache:latest "/usr/sbin/sshd -D -p" 9 minutes ago Up 9 minutes 0.0.0.0:32846->22/tcp default-centos-7-data
@@ -176,7 +180,7 @@ c153dfd8e53d e9fa5d3a0d0e "sh -c 'trap exit 0 S" 9 mi
176180
#### List images
177181

178182
```shell
179-
laptop:~/src/chef-cookbooks/hello_dokken$ docker images
183+
$ docker images
180184
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
181185
default-centos-7 latest ec1d208d77cd 8 minutes ago 172.3 MB
182186
someara/kitchen-cache latest abbdb063dff1 2 weeks ago 300.8 MB
@@ -187,7 +191,7 @@ centos 7 e9fa5d3a0d0e 6 weeks ago
187191
#### Diff container
188192

189193
```shell
190-
laptop:~/src/chef-cookbooks/hello_dokken$ docker diff default-centos-7
194+
$ docker diff default-centos-7
191195
A /hello
192196
C /opt
193197
A /opt/chef
@@ -207,7 +211,7 @@ C /var/lib/rpm/__db.003
207211
#### kitchen verify
208212

209213
```shell
210-
laptop:~/src/chef-cookbooks/hello_dokken$ time kitchen verify
214+
$ time kitchen verify
211215
-----> Starting Kitchen (v1.15.0)
212216
-----> Setting up <default-centos-7>...
213217
Finished setting up <default-centos-7> (0m0.00s).
@@ -237,7 +241,7 @@ The `kitchen-verify` phase uses the transport to run acceptance tests, verifying
237241
#### List containers
238242

239243
```shell
240-
laptop:~/src/chef-cookbooks/hello_dokken$ docker ps -a
244+
$ docker ps -a
241245
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
242246
84def4c49ce3 6e1b03ab46-default-centos-7:latest "sh -c 'trap exit ..." 6 minutes ago Up 6 minutes 6e1b03ab46-default-centos-7
243247
f678882b1575 chef/chef:current "true" 9 minutes ago Created chef-current
@@ -246,7 +250,7 @@ f678882b1575 chef/chef:current "true"
246250
#### List images
247251

248252
```shell
249-
laptop:~/src/chef-cookbooks/hello_dokken$ docker images
253+
$ docker images
250254
REPOSITORY TAG IMAGE ID CREATED SIZE
251255
6e1b03ab46-default-centos-7 latest fec1a50470ed 6 minutes ago 192 MB
252256
chef/chef current 01ec788610e2 6 days ago 124 MB
@@ -258,7 +262,7 @@ centos 7 67591570dd29 7 weeks ag
258262
#### kitchen destroy
259263

260264
```shell
261-
laptop:~/src/chef-cookbooks/hello_dokken$ kitchen destroy
265+
$ kitchen destroy
262266
-----> Starting Kitchen (v1.15.0)
263267
-----> Destroying <default-centos-7>...
264268
Deleting local sandbox at /Users/someara/.dokken/sandbox/6e1b03ab46-default-centos-7
@@ -269,15 +273,15 @@ laptop:~/src/chef-cookbooks/hello_dokken$ kitchen destroy
269273
#### List containers
270274

271275
```shell
272-
laptop:~/src/chef-cookbooks/hello_dokken$ docker ps -a
276+
$ docker ps -a
273277
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
274278
f678882b1575 chef/chef:current "true" 10 minutes ago Created chef-current
275279
```
276280

277281
#### List images
278282

279283
```shell
280-
laptop:~/src/chef-cookbooks/hello_dokken$ docker images
284+
$ docker images
281285
REPOSITORY TAG IMAGE ID CREATED SIZE
282286
chef/chef current 01ec788610e2 6 days ago 124 MB
283287
centos 7 67591570dd29 7 weeks ago 192 MB

documentation/PODMAN.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Using Kitchen Dokken with Podman
2+
3+
Using Dokken with podman is a little less straight forward than with Docker. The main problem is volumes are not populated when they are first created.
4+
5+
As per [this issue](https://github.com/test-kitchen/kitchen-dokken/issues/255), we can use lifecycle hooks to create the volume and populate it with the Chef executable before we try and start the main container.
6+
7+
_Note_, if you’re using a specific version of Chef, and not latest, then you need to reference the correct version in your podman create command because this breaks the automatic pulling of the correct version of the Chef Docker image by kitchen-dokken.
8+
9+
```yaml
10+
---
11+
driver:
12+
name: dokken
13+
privileged: true # allows systemd services to start
14+
15+
provisioner:
16+
name: dokken
17+
18+
transport:
19+
name: dokken
20+
21+
verifier:
22+
name: inspec
23+
24+
platforms:
25+
# @see https://github.com/chef-cookbooks/testing_examples/blob/main/kitchen.dokken.yml
26+
# @see https://hub.docker.com/u/dokken
27+
- name: ubuntu-20.04
28+
driver:
29+
image: dokken/ubuntu-20.04
30+
pid_one_command: /bin/systemd
31+
intermediate_instructions:
32+
- RUN /usr/bin/apt-get update
33+
34+
- name: centos-8
35+
driver:
36+
image: dokken/centos-8
37+
pid_one_command: /usr/lib/systemd/systemd
38+
39+
suites:
40+
- name: default
41+
run_list:
42+
- recipe[test_linux::default]
43+
verifier:
44+
inspec_tests:
45+
- test/integration/default
46+
lifecycle:
47+
pre_create:
48+
- podman create --name chef-latest --replace docker.io/chef/chef:latest sh
49+
- podman start chef-latest
50+
post_destroy:
51+
- podman volume prune -f
52+
```

0 commit comments

Comments
 (0)