Watch Aspire live streamsDocsTry Aspire
Watch Aspire live streamsDocsTry

DockerfileStage

Handle
📦 Aspire.Hosting v13.6.0
interface DockerfileStage {
addContainerFiles(
resource: IResource,
rootDestinationPath: string,
logger?: ILogger): DockerfileStage;
arg(
name: string,
defaultValue?: string): DockerfileStage;
cmd(command: string[]): DockerfileStage;
comment(comment: string): DockerfileStage;
copy(
source: string,
destination: string,
chown?: string): DockerfileStage;
copyFrom(
from: string,
source: string,
destination: string,
chown?: string): DockerfileStage;
emptyLine(): DockerfileStage;
entrypoint(command: string[]): DockerfileStage;
env(
name: string,
value: string): DockerfileStage;
expose(port: number): DockerfileStage;
run(command: string): DockerfileStage;
runWithMounts(
command: string,
mounts: string[]): DockerfileStage;
user(user: string): DockerfileStage;
workDir(path: string): DockerfileStage;
}

Methods

Adds COPY --from statements for published container files
addContainerFiles(
resource: IResource,
rootDestinationPath: string,
logger?: ILogger): DockerfileStage
resourceIResource
rootDestinationPathstring
loggerILoggeroptional
DockerfileStage
methodarg
Adds an ARG statement to a Dockerfile stage
arg(
name: string,
defaultValue?: string): DockerfileStage
namestring
defaultValuestringoptional
DockerfileStage
methodcmd
Adds a CMD statement to a Dockerfile stage
cmd(command: string[]): DockerfileStage
commandstring[]
DockerfileStage
methodcomment
Adds a comment to a Dockerfile stage
comment(comment: string): DockerfileStage
commentstring
DockerfileStage
methodcopy
Adds a COPY statement to a Dockerfile stage
copy(
source: string,
destination: string,
chown?: string): DockerfileStage
sourcestring
destinationstring
chownstringoptional
DockerfileStage
methodcopyFrom
Adds a COPY --from statement to a Dockerfile stage
copyFrom(
from: string,
source: string,
destination: string,
chown?: string): DockerfileStage
fromstring
sourcestring
destinationstring
chownstringoptional
DockerfileStage
methodemptyLine
Adds an empty line to a Dockerfile stage
emptyLine(): DockerfileStage
DockerfileStage
Adds an ENTRYPOINT statement to a Dockerfile stage
entrypoint(command: string[]): DockerfileStage
commandstring[]
DockerfileStage
methodenv
Adds an ENV statement to a Dockerfile stage
env(
name: string,
value: string): DockerfileStage
namestring
valuestring
DockerfileStage
methodexpose
Adds an EXPOSE statement to a Dockerfile stage
expose(port: number): DockerfileStage
portnumber
DockerfileStage
methodrun
Adds a RUN statement to a Dockerfile stage
run(command: string): DockerfileStage
commandstring
DockerfileStage
Adds a RUN statement with mounts to a Dockerfile stage
runWithMounts(
command: string,
mounts: string[]): DockerfileStage
commandstring
mountsstring[]
DockerfileStage
methoduser
Adds a USER statement to a Dockerfile stage
user(user: string): DockerfileStage
userstring
DockerfileStage
methodworkDir
Adds a WORKDIR statement to a Dockerfile stage
workDir(path: string): DockerfileStage
pathstring
DockerfileStage