Skip to content

Commit

Permalink
Merge pull request #47 from theohbrothers/docs/readme-add-more-detail…
Browse files Browse the repository at this point in the history
…s-to-usage

Docs (readme): Add more details to usage
  • Loading branch information
leojonathanoh authored Jul 9, 2023
2 parents 3f14e3d + 53b5869 commit f78f4da
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,36 @@ docker run --rm -it \
--device /dev/kvm \
-v $(pwd):/src \
-w /src \
theohbrothers/docker-packer:1.7.7-sops-qemu-ubuntu-20.04 sh -c 'packer --version && packer build template.json'
theohbrothers/docker-packer:1.7.7-sops-qemu-ubuntu-20.04 packer build template.json
```

See docker-compose examples:
See examples:

- [Ubuntu 20.04 VM image](docs/examples/ubuntu2004-qemu)
- [Ubuntu 20.04 VM `.qcow2` image](docs/examples/ubuntu2004-qemu)

### Virtualbox builder

The host may need to have an exact matching virtualbox version, or at least the same virtualbox minor version, if not virtualbox may not be able to start VMs. To verify virtualbox can start VMs, run the following, ensuring there is no error message:

```sh
docker run --rm -it \
--device /dev/vboxdrv \
theohbrothers/docker-packer:1.7.7-sops-virtualbox-7.0.8-ubuntu-20.04 vboxmanage --version
```

If all is well, to build a VM image:

```sh
# Note: The host may need to have an exact matching virtualbox version, or at least the same virtualbox minor version,
# if not virtualbox may not be able to start VMs
docker run --rm -it \
--device /dev/vboxdrv \
-v $(pwd):/src \
-w /src \
theohbrothers/docker-packer:1.7.7-sops-virtualbox-7.0.8-ubuntu-20.04 sh -c 'packer --version && vboxmanage --version && packer build template.json'
theohbrothers/docker-packer:1.7.7-sops-virtualbox-7.0.8-ubuntu-20.04 packer build template.json
```

See docker-compose examples:
See examples:

- [Ubuntu 20.04 VM .ova](docs/examples/ubuntu2004-virtualbox)
- [Ubuntu 20.04 VM `.ova`](docs/examples/ubuntu2004-virtualbox)

### Other builder(s)

Expand Down
24 changes: 16 additions & 8 deletions generate/templates/README.md.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,36 @@ docker run --rm -it \
--device /dev/kvm \
-v `$(pwd):/src \
-w /src \
theohbrothers/docker-packer:$( $VARIANTS | ? { $_['tag'] -match '\bqemu\b' } | Select-Object -First 1 | % { $_['tag'] } ) sh -c 'packer --version && packer build template.json'
theohbrothers/docker-packer:$( $VARIANTS | ? { $_['tag'] -match '\bqemu\b' } | Select-Object -First 1 | % { $_['tag'] } ) packer build template.json
``````
See docker-compose examples:
See examples:
- [Ubuntu 20.04 VM image](docs/examples/ubuntu2004-qemu)
- [Ubuntu 20.04 VM ``.qcow2`` image](docs/examples/ubuntu2004-qemu)
### Virtualbox builder
The host may need to have an exact matching virtualbox version, or at least the same virtualbox minor version, if not virtualbox may not be able to start VMs. To verify virtualbox can start VMs, run the following, ensuring there is no error message:
``````sh
docker run --rm -it \
--device /dev/vboxdrv \
theohbrothers/docker-packer:$( $VARIANTS | ? { $_['tag'] -match '\bvirtualbox\b' } | Select-Object -First 1 | % { $_['tag'] } ) vboxmanage --version
``````
If all is well, to build a VM image:
``````sh
# Note: The host may need to have an exact matching virtualbox version, or at least the same virtualbox minor version,
# if not virtualbox may not be able to start VMs
docker run --rm -it \
--device /dev/vboxdrv \
-v `$(pwd):/src \
-w /src \
theohbrothers/docker-packer:$( $VARIANTS | ? { $_['tag'] -match '\bvirtualbox\b' } | Select-Object -First 1 | % { $_['tag'] } ) sh -c 'packer --version && vboxmanage --version && packer build template.json'
theohbrothers/docker-packer:$( $VARIANTS | ? { $_['tag'] -match '\bvirtualbox\b' } | Select-Object -First 1 | % { $_['tag'] } ) packer build template.json
``````
See docker-compose examples:
See examples:
- [Ubuntu 20.04 VM .ova](docs/examples/ubuntu2004-virtualbox)
- [Ubuntu 20.04 VM ``.ova``](docs/examples/ubuntu2004-virtualbox)
### Other builder(s)
Expand Down

0 comments on commit f78f4da

Please sign in to comment.