Download the PHP package axy/docker-dockerfile-builder without Composer
On this page you can find all versions of the php package axy/docker-dockerfile-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download axy/docker-dockerfile-builder
More information about axy/docker-dockerfile-builder
Files in axy/docker-dockerfile-builder
Download axy/docker-dockerfile-builder
More information about axy/docker-dockerfile-builder
Files in axy/docker-dockerfile-builder
Vendor axy
Package docker-dockerfile-builder
Short Description Builds a dockerfile
License MIT
Homepage https://github.com/axypro/docker-dockerfile-builder
Package docker-dockerfile-builder
Short Description Builds a dockerfile
License MIT
Homepage https://github.com/axypro/docker-dockerfile-builder
Please rate this library. Is it a good library?
Informations about the package docker-dockerfile-builder
axy\docker\dockerfile\builder
The class that builds dockerfile.
The package is used for specific things. Some options are not tested. Some things are done ineffectively. Using this package is recommended for nobody.
Hierarchy of classes
DockerfileBuileder
- common builderDockerfilePHPBuilder
- added some PHP specific features
Example
Result:
DockerfileBuilder
__construct(public string $image, public bool $isAlpine = true)
image
- the image nameisAlpine
- use alpine distributive (see "Package Manager" below)
Properties
string|array|null $cmd
- CMD instruction (NULL - no CMD)string|array|null $entrypoint
- see CMDstring[] $labels
- LABELs (key => value)string[] $env
- environment variables (key => value)string[] $directives
- directives (key => value)string[] $args
- ARGs (key => value)?string $syntax
-syntax
directive separately?string $escape
-escape
directive separatelystring[] $volume
- list of volumesstring[] $expose
- list of expose portsbool $isPackagesCacheDisabled
- see "Package Manager" below
Methods
All these methods add one instruction to the dockerfile.
The argument $comment
add comment line before the instruction.
instruction(string|string[] $instruction, ?string $comment)
$instruction
- an instruction as string or multiline (joined by "\")
run(string|string[] $commands, ?string $comment)
$commands
- a command forRUN
instructions or a list of commands (joined by "&&")
copy(string|string[] $src, string $dest, ?string $chown)
- COPY instructionadd(string|string[] $src, string $dest, ?string $chown)
- ADD instructionworkdir(string $dir, ?string $comment = null)
- WORKDIR instructionpackages(string[] $packages, ?string $comment)
$packages
- a list of packages for installation- See "Package Manager" below
Build
build(bool $pretty = true)
- returns the dockerfile content$pretty
- if FALSE, empty lines and comments will be deleted
Package Manager
- Alpine uses "apk"
- Not alpine uses "apt-get"
- Before install "update" will be performed
- With multiple call
packages()
, "update" will be performed only for the first - If
$isPackagesCacheDisabled
is TRUE (by default)- alpine - install will be executed with
--no-cache
- other - the cache directory will be deleted at the end
- alpine - install will be executed with
DockerfilePHPBuilder
bool $isComposerRequired
- if TRUE (by default) the composer will be installed globallystring[] $extensions
- the list of names of extensions that required for installationstring[] $pecl
- the list of names of extensions that installed via peclstring[] $ini
- the list of php.ini settings (key => value)
All versions of docker-dockerfile-builder with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.0
The package axy/docker-dockerfile-builder contains the following files
Loading the files please wait ....