lingua-franca 0.10.1
Lingua Franca code generator
Loading...
Searching...
No Matches
org.lflang.generator.docker.DockerGenerator Class Referenceabstract

A class for generating docker files. More...

Inherited by org.lflang.generator.docker.CDockerGenerator, and org.lflang.generator.docker.TSDockerGenerator.

Public Member Functions

abstract List< String > defaultEntryPoint ()
 The default list of commands to construct an ENTRYPOINT out of.
abstract String defaultImage ()
 Return the default base image.
 DockerGenerator (LFGeneratorContext context)
 The constructor for the base docker file generation class.
DockerData generateDockerData ()
 Produce a DockerData object, which bundles all information needed to output a Dockerfile.
DockerData generateDockerData (Path path)
 Return a new DockerData object that can be used to generate a Dockerfile in the directory indicated by the given path.

Static Public Member Functions

static String argListToCommand (List< String > args)
 Convert an argument list, starting with the command to execute, into a string that can be executed by a POSIX-compliant shell.
static DockerGenerator dockerGeneratorFactory (LFGeneratorContext context)

Protected Member Functions

String builderBase ()
 Return the base image to be used during the building stage.
abstract List< String > defaultBuildCommands ()
 Return the default compile commands for the C docker container.
List< String > entryPoint ()
 Return a list of strings used to construct and entrypoint.
String generateCopyForSources ()
 Return a COPY command for copying sources from host into container.
String generateCopyOfExecutable ()
 Return a COPY command to copy the executable from the builder to the runner.
String generateCopyOfScript ()
 Return a COPY command to copy the scripts from the builder to the runner.
String generateCopyOfUserFiles ()
 Return zero or more COPY commands to copy files specified using the files target property from the builder to the runner.
String generateDockerFileContent ()
 Generate the contents of the docker file.
String generateEntryPoint ()
 Return the ENTRYPOINT command.
String generateHeader ()
 Generate a header to print at the top of the Dockerfile.
String generateRunForBuild ()
 Return the Docker RUN command used for building.
abstract String generateRunForInstallingDeps ()
 Return a RUN command for installing/checking build dependencies.
String generateRunForMakingExecutableDir ()
 Return a RUN command for making a directory to place executables in.
List< String > getBuildCommands ()
 Return the commands used to build.
final List< String > getEntryPointCommands ()
 Return a list of commands to be used to construct an ENTRYPOINT, taking into account the existence of a possible pre-run script.
List< String > getPostBuildCommand ()
 Return the command that sources the post-build script, if there is one.
List< String > getPreBuildCommand ()
 Return the command that sources the pre-build script, if there is one.
String runnerBase ()
 Return the base image to be used during the running stage.

Protected Attributes

final LFGeneratorContext context
 Configuration for interactions with the filesystem.

Detailed Description

A class for generating docker files.

Author
Marten Lohstroh
Hou Seng Wong

Constructor & Destructor Documentation

◆ DockerGenerator()

org.lflang.generator.docker.DockerGenerator.DockerGenerator ( LFGeneratorContext context)

The constructor for the base docker file generation class.

Parameters
contextThe context of the code generator.

Member Function Documentation

◆ argListToCommand()

String org.lflang.generator.docker.DockerGenerator.argListToCommand ( List< String > args)
static

Convert an argument list, starting with the command to execute, into a string that can be executed by a POSIX-compliant shell.

◆ builderBase()

String org.lflang.generator.docker.DockerGenerator.builderBase ( )
protected

Return the base image to be used during the building stage.

Reimplemented in org.lflang.generator.docker.RtiDockerGenerator.

◆ defaultBuildCommands()

abstract List< String > org.lflang.generator.docker.DockerGenerator.defaultBuildCommands ( )
abstractprotected

Return the default compile commands for the C docker container.

Reimplemented in org.lflang.generator.docker.CDockerGenerator, and org.lflang.generator.docker.TSDockerGenerator.

◆ defaultEntryPoint()

abstract List< String > org.lflang.generator.docker.DockerGenerator.defaultEntryPoint ( )
abstract

The default list of commands to construct an ENTRYPOINT out of.

Different for each target.

Reimplemented in org.lflang.generator.docker.CDockerGenerator, org.lflang.generator.docker.PythonDockerGenerator, and org.lflang.generator.docker.TSDockerGenerator.

◆ defaultImage()

abstract String org.lflang.generator.docker.DockerGenerator.defaultImage ( )
abstract

◆ dockerGeneratorFactory()

DockerGenerator org.lflang.generator.docker.DockerGenerator.dockerGeneratorFactory ( LFGeneratorContext context)
static

◆ entryPoint()

List< String > org.lflang.generator.docker.DockerGenerator.entryPoint ( )
protected

Return a list of strings used to construct and entrypoint.

If this is done for a federate, then also include additional parameters to pass in the federation ID.

◆ generateCopyForSources()

String org.lflang.generator.docker.DockerGenerator.generateCopyForSources ( )
protected

Return a COPY command for copying sources from host into container.

Reimplemented in org.lflang.generator.docker.TSDockerGenerator.

◆ generateCopyOfExecutable()

String org.lflang.generator.docker.DockerGenerator.generateCopyOfExecutable ( )
protected

Return a COPY command to copy the executable from the builder to the runner.

Reimplemented in org.lflang.generator.docker.PythonDockerGenerator, and org.lflang.generator.docker.TSDockerGenerator.

◆ generateCopyOfScript()

String org.lflang.generator.docker.DockerGenerator.generateCopyOfScript ( )
protected

Return a COPY command to copy the scripts from the builder to the runner.

◆ generateCopyOfUserFiles()

String org.lflang.generator.docker.DockerGenerator.generateCopyOfUserFiles ( )
protected

Return zero or more COPY commands to copy files specified using the files target property from the builder to the runner.

◆ generateDockerData() [1/2]

DockerData org.lflang.generator.docker.DockerGenerator.generateDockerData ( )

Produce a DockerData object, which bundles all information needed to output a Dockerfile.

Returns
docker data created based on the context in this instance

◆ generateDockerData() [2/2]

DockerData org.lflang.generator.docker.DockerGenerator.generateDockerData ( Path path)

Return a new DockerData object that can be used to generate a Dockerfile in the directory indicated by the given path.

Parameters
pathThe directory in which to place the generated Dockerfile.

◆ generateDockerFileContent()

String org.lflang.generator.docker.DockerGenerator.generateDockerFileContent ( )
protected

Generate the contents of the docker file.

Reimplemented in org.lflang.generator.docker.RtiDockerGenerator.

◆ generateEntryPoint()

String org.lflang.generator.docker.DockerGenerator.generateEntryPoint ( )
protected

Return the ENTRYPOINT command.

◆ generateHeader()

String org.lflang.generator.docker.DockerGenerator.generateHeader ( )
protected

Generate a header to print at the top of the Dockerfile.

◆ generateRunForBuild()

String org.lflang.generator.docker.DockerGenerator.generateRunForBuild ( )
protected

Return the Docker RUN command used for building.

◆ generateRunForInstallingDeps()

abstract String org.lflang.generator.docker.DockerGenerator.generateRunForInstallingDeps ( )
abstractprotected

Return a RUN command for installing/checking build dependencies.

Reimplemented in org.lflang.generator.docker.CDockerGenerator, and org.lflang.generator.docker.TSDockerGenerator.

◆ generateRunForMakingExecutableDir()

String org.lflang.generator.docker.DockerGenerator.generateRunForMakingExecutableDir ( )
protected

Return a RUN command for making a directory to place executables in.

Reimplemented in org.lflang.generator.docker.TSDockerGenerator.

◆ getBuildCommands()

List< String > org.lflang.generator.docker.DockerGenerator.getBuildCommands ( )
protected

Return the commands used to build.

◆ getEntryPointCommands()

final List< String > org.lflang.generator.docker.DockerGenerator.getEntryPointCommands ( )
protected

Return a list of commands to be used to construct an ENTRYPOINT, taking into account the existence of a possible pre-run script.

◆ getPostBuildCommand()

List< String > org.lflang.generator.docker.DockerGenerator.getPostBuildCommand ( )
protected

Return the command that sources the post-build script, if there is one.

◆ getPreBuildCommand()

List< String > org.lflang.generator.docker.DockerGenerator.getPreBuildCommand ( )
protected

Return the command that sources the pre-build script, if there is one.

◆ runnerBase()

String org.lflang.generator.docker.DockerGenerator.runnerBase ( )
protected

Return the base image to be used during the running stage.

Member Data Documentation

◆ context

final LFGeneratorContext org.lflang.generator.docker.DockerGenerator.context
protected

Configuration for interactions with the filesystem.


The documentation for this class was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/generator/docker/DockerGenerator.java