You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/containerized-execution.mdx
+28-10Lines changed: 28 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -11,17 +11,8 @@ target C {
11
11
}
12
12
```
13
13
14
-
The generated Docker file has the same name as the LF file except that the extension is `.Dockerfile` and will be put in the `src-gen` directory. You can also specify options. Currently, only the base image (`FROM`) can be customized, but this will be extended to allow further customization is the future. To customize the Docker file, instead of just `true` above, which gives default options, specify the options as in the following example:
14
+
The generated Docker file is simply called `Dockerfile` and will be put in the `src-gen` directory. You will need to [install Docker](https://docs.docker.com/get-docker/) in order to use this.
15
15
16
-
```lf-c
17
-
target C {
18
-
docker: {FROM: "alpine:latest"}
19
-
}
20
-
```
21
-
22
-
This specifies that the base image is the latest version of `alpine`, a very small Linux. In fact, `alpine:latest` is the default value for this option, so you only need to specify this option if you need something other than `alpine:latest`.
23
-
24
-
How to use this depends on whether your application is federated. You will need to [install Docker](https://docs.docker.com/get-docker/) if you haven't already in order to use this.
25
16
26
17
## Unfederated Execution
27
18
Suppose your LF source file is `src/Foo.lf`. When you run `lfc` or use the IDE to generate code, a file called `Dockerfile` and a file called `docker-compose.yml` will appear in the `src_gen/Foo` directory, see [Structure of an LF project](/docs/handbook/a-first-reactor#structure-of-an-lf-project) for more info.
@@ -104,3 +95,30 @@ The federates `foo` and `bar`, the images of which have already been built, can
104
95
docker run -t --rm --network lf foo
105
96
docker run -t --rm --network lf bar
106
97
```
98
+
99
+
## Configuration Options
100
+
You can further customize the generated Docker file through the `docker` target property. Instead of just enabling Docker support using `true`, specify configuration options in a dictionary.
101
+
102
+
### Select a Base Image
103
+
You can specify a base image (`FROM`) as follows:
104
+
105
+
```lf-c
106
+
target C {
107
+
docker: {FROM: "alpine:latest"}
108
+
}
109
+
```
110
+
111
+
This specifies that the base image is the latest version of `alpine`, a very small Linux. In fact, `alpine:latest` is the default value for this option, so you only need to specify this option if you need something other than `alpine:latest`.
112
+
113
+
### Select an RTI
114
+
By default, an image is pulled from DockerHub that contains the RTI. An alternative image can be specified using the `rti-image` entry as follows:
115
+
116
+
```lf-c
117
+
target C {
118
+
docker: {rti-image: "lflang/rti:latest"}
119
+
}
120
+
```
121
+
122
+
:::note
123
+
To use a local image that is based on source of the RTI provided by `lfc`, use `rti-image: "lflang/rti:rti"`.
0 commit comments