Sign inSign up

traykovski/tcl

By traykovski

•Updated 2 days ago

Tcl 8.5–9.1 for amd64/arm64: Debian, Alpine, Rocky Linux, distroless, plus -dev build images

Image
Languages & frameworks
Developer tools
0

10K+

traykovski/tcl repository overview

⁠Quick reference

⁠Quick reference (cont.)

⁠What is Tcl?

Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful. Tcl casts everything into the mold of a command, even programming constructs like variable assignment and procedure definition. Tcl supports multiple programming paradigms, including object-oriented, imperative, functional, and procedural styles.

These images build Tcl from the official source releases:

TclStatusThreads
9.1.0current (latest)yes (always in Tcl 9)
9.0.4current 9.0yes
8.6.18current 8.6 (8)yes
8.5.19last 8.5 releaseno, as upstream builds 8.5
8.5.13legacy, for applications pinned to this patch levelno

8.6 and 9 include the bundled packages (Thread, sqlite3, TDBC, itcl).

⁠How to use this image

⁠Start an interactive tclsh

$ docker run -it --rm traykovski/tcl:8.6
% info patchlevel
8.6.18

⁠Run a single Tcl script

For many simple, single file projects, you may find it inconvenient to write a complete Dockerfile. In such cases, you can run a Tcl script by using the image directly:

$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp traykovski/tcl:8.6-slim tclsh your-script.tcl

⁠Create a Dockerfile in your Tcl app project

FROM traykovski/tcl:8.6-slim

WORKDIR /usr/src/app
COPY . .

CMD ["tclsh", "./your-script.tcl"]

You can then build and run the Docker image:

$ docker build -t my-tcl-app .
$ docker run -it --rm --name my-running-app my-tcl-app

⁠Build a C extension

Compile on the -dev image and copy the result into the matching runtime image, so the runtime stays small:

FROM traykovski/tcl:8.6-alpine-dev AS build
COPY myext/ /usr/src/myext/
RUN cd /usr/src/myext && ./configure --with-tcl=/usr/local/lib && make && make install

FROM traykovski/tcl:8.6-alpine
COPY --from=build /usr/local/lib/myext1.0/ /usr/local/lib/myext1.0/

⁠Caveats

  • Tcl 8.5 is built without threads, as upstream builds it; 8.6 and 9 are threaded. Compiled extensions must match the Tcl they load into.
  • Scripts with a hardcoded #!/usr/bin/tclsh work as-is: images with a shell link /usr/bin/tclsh to the installed tclsh.
  • The -distroless images have no shell, so exec can only run what is in the image.

⁠Image Variants

The traykovski/tcl images come in many flavors, each designed for a specific use case.

⁠traykovski/tcl:<version>

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.

This tag is based off of buildpack-deps⁠ (Debian trixie). It includes gcc and the Tcl headers, so extensions can be built in place (~1.1 GB for 8.6).

⁠traykovski/tcl:<version>-slim

This image does not contain the common packages contained in the default tag and only contains the minimal packages needed to run Tcl (Debian trixie slim, ~117 MB). Unless you are working in an environment where only the Tcl image will be deployed and you have space constraints, we highly recommend using the default image of this repository.

⁠traykovski/tcl:<version>-alpine

This image is based on the popular Alpine Linux project⁠, available in the alpine official image⁠. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general (~23 MB here).

This variant is useful when final image size being as small as possible is your primary concern. The main caveat to note is that it does use musl libc⁠ instead of glibc and friends⁠, so software will often run into issues depending on the depth of their libc requirements/assumptions.

⁠traykovski/tcl:<version>-rocky9-minimal, traykovski/tcl:<version>-rocky8-minimal

Based on Rocky Linux⁠ minimal (~182 MB and ~113 MB), for applications that run on RHEL-family systems and need the same C library and packages.

⁠traykovski/tcl:<version>-distroless

Based on Google distroless⁠ cc-debian13 (~47 MB): no shell and no package manager. tclsh is the entrypoint.

⁠traykovski/tcl:<version>-<variant>-dev

The slim, Alpine and Rocky Linux variants also come as -dev images: the same Tcl plus make, gcc, C library and zlib headers, and curl. Use them as the build stage for extensions, then copy the result into the matching runtime image.

⁠License

View license information⁠ for the software contained in this image. Tcl's license is included in every image at /usr/local/share/licenses/tcl/license.terms; the build files are MIT licensed.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

Tag summary

Content type

Image

Digest

sha256:45e0aede2…

Size

13.7 MB

Last updated

2 days ago

docker pull traykovski/tcl:distroless