# Images and tags

CrushMFT 27's images are on Docker Hub as **`crushftp/crushmft27`** (`docker.io/crushftp/crushmft27`). Every build of CrushMFT 27 that passes its tests is published there, for `linux/amd64` and `linux/arm64`; Docker picks the right one by itself.

## The images

| Tag | For | Shell |
|---|---|---|
| `27.0.0_289` | running CrushMFT | none |
| `27.0.0_289-dev` | the same, and looking around inside | bash, the core tools (`ls`, `cat`, `cp`, ...), `grep`, `sed`, `find`, `ps`, `curl` |
| `27.0.0_289-fips` | CrushMFT in [FIPS 140-3 mode](#fips-140-3-mode) | none |
| `27.0.0_289-dev-fips` | the same with the `-dev` tools | bash and the tools |

All of them run the same program in the same way, with the same data folder, and all have `java`, `keytool`, `jcmd` and `jfr`. You can switch between the plain and the `-dev` image on the same volume at any time: stop the container and start the other one. Use the plain image in production; use `-dev` when you need a shell (`docker exec -it <container> bash`). The `-fips` images change how the server runs; see below before switching to or from them.

## Tags

| Tag | Means |
|---|---|
| `27.0.0_289` | one build: CrushMFT's version, the number after `_` being the build. It never changes. |
| `27.0.0_289-dev`, `-fips`, `-dev-fips` | the other images of that build |
| `latest` | the newest build. It moves with every new build, never back to an older one. |
| `latest-dev`, `latest-fips`, `latest-dev-fips` | the same for the other images |

The version is the one CrushMFT shows on its About page and in its log. Every build has a higher one.

**In production, pin a tag** (`crushftp/crushmft27:27.0.0_289`), so a restart never brings a different version by surprise. Use `latest` to try things. The list of tags: `https://hub.docker.com/r/crushftp/crushmft27/tags`.

Tags of the form `27.0.0_0-240` are from early test builds with another folder layout. Don't use them.

## Which build is in an image

```
docker image inspect crushftp/crushmft27:latest --format '{{index .Config.Labels "com.crushftp.version"}}'
```

| Label | Holds |
|---|---|
| `com.crushftp.version` | CrushMFT's version, e.g. `27.0.0_289` (on the `-fips` images too) |
| `org.opencontainers.image.version` | the tag, e.g. `27.0.0_289` or `27.0.0_289-fips` |
| `com.crushftp.fips` | `true` on the `-fips` images |
| `org.opencontainers.image.title`, `.vendor`, `.description`, `.source` | CrushMFT 27, CrushFTP, LLC, ... |

## What is inside

| | |
|---|---|
| `/app` | the program, read-only: the `CrushMFT27` folder exactly as the download has it (`CrushMFT.jar`, `CrushLauncher.jar`, `plugins/`, `WebInterface/`, the starters, and `release.txt`, the signed list of every file with its size and SHA-256), and the start program `container/CrushContainer.jar` |
| `/app/CrushMFT27` | the **working folder**: empty in the image, meant to be a volume. Everything CrushMFT writes goes here, its own copy of the program included. |
| Java | Eclipse Temurin 27, reduced to the parts CrushMFT uses, with `-XX:-UseBASE64Intrinsics` built in (see [Security](Security.md)). `docker run --rm --entrypoint java crushftp/crushmft27 -version` shows the exact build. |
| User | uid `65532`, gid `0`. Not root. |
| Environment | `PASSFILE=/app/CrushMFT27/passfile`, `LANG` and `LC_ALL` `C.UTF-8` (file names with accents and other scripts are kept exactly), `SSL_CERT_FILE`, `JAVA_HOME`, `PATH` |
| Ports declared | 21, 443, 2222, 8080, 9090 |
| Volume declared | `/app/CrushMFT27` |
| Start | `java -XX:MaxRAMPercentage=50 -Dcrushmft.image=/app -jar /app/container/CrushContainer.jar`, with the arguments `-ad crushadmin`. The `-fips` images add `-Dcrushmft.fips=true` after the heap. |
| Size (amd64, compressed) | about 110 MB; `-dev` about 130 MB |

There are no fonts and no X11 libraries: a server draws no windows. What happens at a start is in [How it works](How-It-Works.md).

## FIPS 140-3 mode

The `-fips` images are the plain image plus the FIPS extras of the same CrushMFT build (the validated module's jars in `/app/plugins/lib/`), started with `-Dcrushmft.fips=true`. CrushMFT then does all of its cryptography with the validated module and refuses what FIPS 140-3 does not allow.

Before the first start of a new version on a volume, the image prepares the volume for FIPS mode (`-FIPS_PREPARE`): the server's own key for stored secrets (`secret.key` in the volume), a certificate of its own instead of the built-in one, key stores copied into the FIPS format, stored secrets sealed again. A new volume first gets a short first start that creates the folder. The variable `CRUSHFTP_FIPS_PREPARE=false` turns this off. **Keep a copy of `secret.key` apart from the volume**: nothing stored can be read without it.

Everything about FIPS mode, in containers too (what changes, the key, the chart's values, a refused start), is on the CrushMFT 27 page [FIPS 140-3 mode](../CrushMFT27/FIPS-Mode.md), part "Docker and Helm".

## Signatures and the list of contents

Every image is signed with CrushFTP's key, and each platform image carries an SPDX list of every package in it (an SBOM), signed as well. Both are made by the build before `latest` moves. To check them you need [cosign](https://docs.sigstore.dev/cosign/system_config/installation/) and the public key:

[cosign.pub](Images/cosign.pub) (SHA-256 `c8bb257a396406f3f6b617d3a9163bef6c5fe375b6a1843089b1e4fadc7d6576`):

```
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYbSL9dqv43KmJAI8m4J6mKEA/qCr
y8GDcCpslZQdyDn0biYiogH6H/mU1NiWrzkpYhaKwJNskQDZuVuI4/2KwA==
-----END PUBLIC KEY-----
```

```
cosign verify --key cosign.pub crushftp/crushmft27:27.0.0_289
cosign verify-attestation --key cosign.pub --type spdxjson crushftp/crushmft27:27.0.0_289 | jq -r .payload | base64 -d | jq '.predicate.packages | length'
```

The first command checks the signature of the tag (and of both platform images under it); the second checks and reads the SBOM. A changed or unsigned image fails. The signatures are also recorded in Sigstore's public transparency log, which `cosign verify` checks by default. The same key signs the CrushFTP 11 images.

Inside the program, CrushMFT checks the signature of `release.txt` and every file it names at every start as well ([How it works](How-It-Works.md)).

## Getting the image without Docker Hub

For a machine without access to Docker Hub, save the image on a machine that has it and load it there:

```
docker pull --platform linux/amd64 crushftp/crushmft27:27.0.0_289
docker save crushftp/crushmft27:27.0.0_289 -o crushmft27.tar
# copy crushmft27.tar over, then:
docker load -i crushmft27.tar
```

To keep the images in your own registry, copy them with their signatures, e.g. `skopeo copy --all docker://crushftp/crushmft27:27.0.0_289 docker://registry.example.com/crushmft27:27.0.0_289` (`--all` keeps both platforms).
