Update docker.#Dockerfile to be a 1:1 mirror to engine.#Dockerfile

Signed-off-by: Vasek - Tom C <tom.chauveau@epitech.eu>
This commit is contained in:
Vasek - Tom C 2022-01-28 13:48:39 +01:00
parent 22183cb092
commit 562678779e
No known key found for this signature in database
GPG Key ID: 175D82E572427960

View File

@ -61,18 +61,54 @@ import (
// Build step that executes a Dockerfile
#Dockerfile: {
// Source directory
source: dagger.#FS
// Source image
input?: #Image
// FIXME: not yet implemented
*{
// Look for Dockerfile in source at default path
path: "Dockerfile"
// FIXME cannot replace with _source: *engine.#Scratch | input.rootfs
// Got error "$dagger" not found
_source: input.rootfs
if input == _|_ {
_source: engine.#Scratch
}
// Dockerfile definition or path into source
dockerfile: *{
path: string | *"Dockerfile"
} | {
// Look for Dockerfile in source at a custom path
path: string
} | {
// Custom dockerfile contents
contents: string
}
// Registry authentication
// Key must be registry address
auth: [registry=string]: {
username: string
secret: dagger.#Secret
}
platforms: [...string]
target?: string
buildArg: [string]: string
label: [string]: string
hosts: [string]: string
_build: engine.#Dockerfile & {
source: _source
"auth": [ for target, creds in auth {
"target": target
creds
}]
"dockerfile": dockerfile
"platforms": platforms
if target != _|_ {
"target": target
}
"buildArg": buildArg
"label": label
"hosts": hosts
}
output: #Image & {
rootfs: _build.output
config: _build.config
}
}