Crate dofigen_lib

Source
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§

lock

Structs§

Add
Represents the ADD instruction in a Dockerfile file from URLs or uncompress an archive.
AddGitRepo
Represents the ADD instruction in a Dockerfile specific for Git repo. See https://docs.docker.com/reference/dockerfile/#adding-private-git-repositories
AddGitRepoPatch
AddPatch
Bind
Represents file system binding during a run See https://docs.docker.com/reference/dockerfile/#run—mounttypebind
BindPatch
Cache
Represents a cache definition during a run See https://docs.docker.com/reference/dockerfile/#run—mounttypecache
CachePatch
Copy
Represents the COPY instruction in a Dockerfile. See https://docs.docker.com/reference/dockerfile/#copy
CopyContent
Represents the COPY instruction in a Dockerfile from file content. See https://docs.docker.com/reference/dockerfile/#example-creating-inline-files
CopyContentPatch
CopyOptions
Represents the options of a COPY/ADD instructions
CopyOptionsPatch
CopyPatch
DockerHubTagResponse
Dofigen
Represents the Dockerfile main stage
DofigenContext
The representation of the Dofigen execution context
DofigenPatch
Extend
GenerationContext
HashMapDeepPatch
HashMapPatch
Healthcheck
Represents the Dockerfile healthcheck instruction See https://docs.docker.com/reference/dockerfile/#healthcheck
HealthcheckPatch
ImageName
Represents a Docker image name
ImageNamePatch
LintMessage
LintSession
OneOrMany
One or many values
ParsableStruct
A struct that can be parsed from a string
Port
Represents a port definition
PortPatch
Run
Represents a run command
RunPatch
Stage
Represents a Dockerfile stage
StageLintInfo
StagePatch
UnknownPatch
User
Represents user and group definition
UserPatch
VecDeepPatch
Patch for Vec that handle some commands based on the position:
VecPatch
Patch for Vec that handle some commands based on the position:

Enums§

CacheSharing
Represents a cache sharing strategy
CopyResource
CopyResourcePatch
Error
FromContext
Represents a copy origin
FromContextPatch
ImageVersion
Represents a Docker image version
MessageLevel
PortProtocol
Represents a port protocol
Resource
Represents a resource
UpdateCommand

Functions§

generate_dockerfileDeprecated
Generates the Dockerfile content from a Dofigen struct.
generate_dockerignoreDeprecated
Generates the .dockerignore file content from an Dofigen struct.
generate_effective_content
Generates the effective Dofigen content from a Dofigen struct.

Type Aliases§

Result