| Dockerfile {dockerfiler} | R Documentation |
A Dockerfile template
Description
A Dockerfile template
A Dockerfile template
Public fields
DockerfileThe dockerfile content.
Methods
Public methods
Method new()
Create a new Dockerfile object.
Usage
Dockerfile$new(FROM = "rocker/r-base", AS = NULL)
Arguments
FROMThe base image.
ASThe name of the image.
Returns
A Dockerfile object.
Method RUN()
Add a RUN command.
Usage
Dockerfile$RUN(cmd)
Arguments
cmdThe command to add.
Returns
the Dockerfile object, invisibly.
Method ADD()
Add a ADD command.
Usage
Dockerfile$ADD(from, to, force = TRUE)
Arguments
fromThe source file.
toThe destination file.
forceIf TRUE, overwrite the destination file.
Returns
the Dockerfile object, invisibly.
Method COPY()
Add a COPY command.
Usage
Dockerfile$COPY(from, to, force = TRUE)
Arguments
fromThe source file.
toThe destination file.
forceIf TRUE, overwrite the destination file.
Returns
the Dockerfile object, invisibly.
Method WORKDIR()
Add a WORKDIR command.
Usage
Dockerfile$WORKDIR(where)
Arguments
whereThe working directory.
Returns
the Dockerfile object, invisibly.
Method EXPOSE()
Add a EXPOSE command.
Usage
Dockerfile$EXPOSE(port)
Arguments
portThe port to expose.
Returns
the Dockerfile object, invisibly.
Method VOLUME()
Add a VOLUME command.
Usage
Dockerfile$VOLUME(volume)
Arguments
volumeThe volume to add.
Returns
the Dockerfile object, invisibly.
Method CMD()
Add a CMD command.
Usage
Dockerfile$CMD(cmd)
Arguments
cmdThe command to add.
Returns
the Dockerfile object, invisibly.
Method LABEL()
Add a LABEL command.
Usage
Dockerfile$LABEL(key, value)
Arguments
key, valueThe key and value of the label.
Returns
the Dockerfile object, invisibly.
Method ENV()
Add a ENV command.
Usage
Dockerfile$ENV(key, value)
Arguments
key, valueThe key and value of the label.
Returns
the Dockerfile object, invisibly.
Method ENTRYPOINT()
Add a ENTRYPOINT command.
Usage
Dockerfile$ENTRYPOINT(cmd)
Arguments
cmdThe command to add.
Returns
the Dockerfile object, invisibly.
Method USER()
Add a USER command.
Usage
Dockerfile$USER(user)
Arguments
userThe user to add.
Returns
the Dockerfile object, invisibly.
Method ARG()
Add a ARG command.
Usage
Dockerfile$ARG(arg, ahead = FALSE)
Arguments
argThe argument to add.
aheadIf TRUE, add the argument at the beginning of the Dockerfile.
Returns
the Dockerfile object, invisibly.
Method ONBUILD()
Add a ONBUILD command.
Usage
Dockerfile$ONBUILD(cmd)
Arguments
cmdThe command to add.
Returns
the Dockerfile object, invisibly.
Method STOPSIGNAL()
Add a STOPSIGNAL command.
Usage
Dockerfile$STOPSIGNAL(signal)
Arguments
signalThe signal to add.
Returns
the Dockerfile object, invisibly.
Method HEALTHCHECK()
Add a HEALTHCHECK command.
Usage
Dockerfile$HEALTHCHECK(check)
Arguments
checkThe check to add.
Returns
the Dockerfile object, invisibly.
Method SHELL()
Add a SHELL command.
Usage
Dockerfile$SHELL(shell)
Arguments
shellThe shell to add.
Returns
the Dockerfile object, invisibly.
Method MAINTAINER()
Add a MAINTAINER command.
Usage
Dockerfile$MAINTAINER(name, email)
Arguments
name, emailThe name and email of the maintainer.
Returns
the Dockerfile object, invisibly.
Method custom()
Add a custom command.
Usage
Dockerfile$custom(base, cmd)
Arguments
base, cmdThe base and command to add.
Returns
the Dockerfile object, invisibly.
Method print()
Print the Dockerfile.
Usage
Dockerfile$print()
Returns
used for side effect
Method write()
Write the Dockerfile to a file.
Usage
Dockerfile$write(as = "Dockerfile")
Arguments
asThe file to write to.
Returns
used for side effect
Method switch_cmd()
Switch commands.
Usage
Dockerfile$switch_cmd(a, b)
Arguments
a, bThe commands to switch.
Returns
the Dockerfile object, invisibly.
Method remove_cmd()
Remove a command.
Usage
Dockerfile$remove_cmd(where)
Arguments
whereThe commands to remove.
Returns
the Dockerfile object, invisibly.
Method add_after()
Add a command after another.
Usage
Dockerfile$add_after(cmd, after)
Arguments
cmdThe command to add.
afterWhere to add the cmd
Returns
the Dockerfile object, invisibly.
Method clone()
The objects of this class are cloneable with this method.
Usage
Dockerfile$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
my_dock <- Dockerfile$new()