Creating Containers
Overview
Tangram Pro will build container images for your components or transforms when you provide a Dockerfile.
- Images are built for each component separately. Provide a Dockerfile for each one.
- The selected transport(s) will automatically have an image built (except for TCP, UDP and Serial).
- Separate component containers communicate with each other via the transport container.
Dockerfile Suggestions
The first line should include the image you want to create a layer from (e.g. FROM ubuntu:22.04
).
If your container needs to be built with an image from a private registry, you can authorize your Tangram Pro account to access it. You'll need to authorize each private registry for your container before starting a build. See Container Registries
Use COPY
to copy the build artifacts generated by Tangram Pro into the container. (Note: the "Include Generated Code" option must be enabled.)
Copy Component Artifacts
The component artifacts are in a folder named code-gen
FROM ubuntu:22.04
COPY /code-gen /working/code-gen
WORKDIR /working/code-gen
CMD [ "sh", "-c", "sleep 2 && ls *" ]
When run, this container will list the contents of the code-gen folder.
Copy Transform Artifacts
Transform with CSIs
The transform artifacts are in a folder named out
if the build option Generate Transform with CSIs
was used.
FROM ubuntu:22.04
COPY /out /working/out
WORKDIR /working/out
CMD [ "sh", "-c", "sleep 2 && ls *" ]
When run, this container will list the contents of the out folder.
Transform without CSIs
The transform artifacts are in a folder named transform
if the build option Generate Transform Code
was used.
FROM ubuntu:22.04
COPY /transform /working/transform
WORKDIR /working/transform
CMD [ "sh", "-c", "sleep 2 && ls *" ]
When run, this container will list the contents of the transform folder.