Expand description
§dofigen_lib
dofigen_lib
help creating Dockerfile with a simplified structure and made to cache the build with Buildkit.
You also can parse the structure from YAML or JSON.
use dofigen_lib::*;
use pretty_assertions_sorted::assert_eq_sorted;
let mut context = DofigenContext::new();
let dofigen = context.parse_from_string(r#"
fromImage:
path: ubuntu
"#).unwrap();
let dockerfile = generate_dockerfile(&dofigen).unwrap();
Modules§
Structs§
- Add
- Represents the ADD instruction in a Dockerfile file from URLs or uncompress an archive.
- AddGit
Repo - Represents the ADD instruction in a Dockerfile specific for Git repo. See https://docs.docker.com/reference/dockerfile/#adding-private-git-repositories
- AddGit
Repo Patch - AddPatch
- Bind
- Represents file system binding during a run See https://docs.docker.com/reference/dockerfile/#run—mounttypebind
- Bind
Patch - Cache
- Represents a cache definition during a run See https://docs.docker.com/reference/dockerfile/#run—mounttypecache
- Cache
Patch - Copy
- Represents the COPY instruction in a Dockerfile. See https://docs.docker.com/reference/dockerfile/#copy
- Copy
Content - Represents the COPY instruction in a Dockerfile from file content. See https://docs.docker.com/reference/dockerfile/#example-creating-inline-files
- Copy
Content Patch - Copy
Options - Represents the options of a COPY/ADD instructions
- Copy
Options Patch - Copy
Patch - Docker
HubTag Response - Dofigen
- Represents the Dockerfile main stage
- Dofigen
Context - The representation of the Dofigen execution context
- Dofigen
Patch - Extend
- Generation
Context - Hash
MapDeep Patch - Hash
MapPatch - Healthcheck
- Represents the Dockerfile healthcheck instruction See https://docs.docker.com/reference/dockerfile/#healthcheck
- Healthcheck
Patch - Image
Name - Represents a Docker image name
- Image
Name Patch - Lint
Message - Lint
Session - OneOr
Many - One or many values
- Parsable
Struct - A struct that can be parsed from a string
- Port
- Represents a port definition
- Port
Patch - Run
- Represents a run command
- RunPatch
- Stage
- Represents a Dockerfile stage
- Stage
Lint Info - Stage
Patch - Unknown
Patch - User
- Represents user and group definition
- User
Patch - VecDeep
Patch - Patch for Vec
that handle some commands based on the position: - VecPatch
- Patch for Vec
that handle some commands based on the position:
Enums§
- Cache
Sharing - Represents a cache sharing strategy
- Copy
Resource - Copy
Resource Patch - Error
- From
Context - Represents a copy origin
- From
Context Patch - Image
Version - Represents a Docker image version
- Message
Level - Port
Protocol - Represents a port protocol
- Resource
- Represents a resource
- Update
Command
Functions§
- generate_
dockerfile Deprecated - Generates the Dockerfile content from a Dofigen struct.
- generate_
dockerignore Deprecated - Generates the .dockerignore file content from an Dofigen struct.
- generate_
effective_ content - Generates the effective Dofigen content from a Dofigen struct.