This folder contains a Packer template for building a Docker image with a specified version of Python installed.
version.pkr.hcl: Specifies the required Packer version and plugins.variables.pkr.hcl: Defines the variables used in the template.template.pkr.hcl: The main Packer template file that defines the build configuration.sources.pkr.hcl: Specifies the source Docker image to use.
-
Packer version 1.7.0 or higher.
-
Docker installed and running on your machine.
brew install docker
To build the Docker image, follow these steps:
-
Clone the repository:
git clone https://github.com/mehrdadmm/Packer-Template-for-Docker.git
-
Initialize the Packer template:
packer init . -
Build the Docker image:
packer build .
By default, the template installs PHP 8.2. To customize the PHP version, you can override the php_version variable:
packer build -var 'php_version=8' .