Skip to content

feat: rename enterprise-* images to example-* while maintaining backward compatibility #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
# Enterprise Example Images
# Coder Example Images

This repository contains example images for use with [Coder](https://coder.com/docs/v2/latest).

- `enterprise-base`: Contains an example image that can be used as a base for
- `example-base`: Contains an example image that can be used as a base for
other images.
- `enterprise-minimal`: Contains a minimal image that contains only the required
- `example-minimal`: Contains a minimal image that contains only the required
utilities for a Coder workspace to bootstrap successfully.
- `example-golang`: Contains Go development tools.
- `example-java`: Contains Java development tools.
- `example-node`: Contains Node.js development tools.
- `example-desktop`: Contains a desktop environment accessible via web browser.

## Images on Docker Hub

Each of these images is also published to Docker Hub under the
`codercom/enterprise-[name]` repository. For example, `base` is available at
https://hub.docker.com/r/codercom/enterprise-base. The tag is taken from the
Each of these images is published to Docker Hub under the
`codercom/example-[name]` repository. For example, `base` is available at
https://hub.docker.com/r/codercom/example-base. The tag is taken from the
filename of the Dockerfile. For example, `base/ubuntu.Dockerfile` is
under the `ubuntu` tag.

> For backward compatibility, these images are also available with the `enterprise-` prefix
> (e.g., `codercom/enterprise-base`), but the `example-` prefix is recommended for new deployments.

## Contributing

See our [contributing guide](.github/CONTRIBUTING.md).
Expand Down
6 changes: 4 additions & 2 deletions scripts/build_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ fi
for image in "${IMAGES[@]}"; do
image_dir="$PROJECT_ROOT/images/$image"
image_file="${TAG}.Dockerfile"
image_ref="codercom/enterprise-$image:$TAG"
enterprise_image_ref="codercom/enterprise-$image:$TAG"
example_image_ref="codercom/example-$image:$TAG"
image_path="$image_dir/$image_file"

if [ ! -f "$image_path" ]; then
Expand All @@ -105,5 +106,6 @@ for image in "${IMAGES[@]}"; do
"${docker_flags[@]}" \
"$image_dir" \
--file="$image_path" \
--tag="$image_ref" \| indent
--tag="$example_image_ref" \
--tag="$enterprise_image_ref" \| indent
done
17 changes: 13 additions & 4 deletions scripts/push_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ date_str=$(date --utc +%Y%m%d)
for image in "${IMAGES[@]}"; do
image_dir="$PROJECT_ROOT/images/$image"
image_file="${TAG}.Dockerfile"
image_ref="codercom/enterprise-$image:$TAG"
image_ref_date="${image_ref}-${date_str}"
enterprise_image_ref="codercom/enterprise-$image:$TAG"
enterprise_image_ref_date="${enterprise_image_ref}-${date_str}"
example_image_ref="codercom/example-$image:$TAG"
example_image_ref_date="${example_image_ref}-${date_str}"
image_path="$image_dir/$image_file"

if [ ! -f "$image_path" ]; then
Expand All @@ -104,7 +106,14 @@ for image in "${IMAGES[@]}"; do
fi

build_id=$(cat "build_${image}.json" | jq -r .\[\"depot.build\"\].buildID)
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "$image_ref" "$build_id"
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "$image_ref_date" "$build_id"

# Push example images (primary)
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "$example_image_ref" "$build_id"
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "$example_image_ref_date" "$build_id"
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "codercom/example-${image}:latest" "$build_id"

# Push enterprise images (alias)
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "$enterprise_image_ref" "$build_id"
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "$enterprise_image_ref_date" "$build_id"
run_trace $DRY_RUN depot push --project "gb3p8xrshk" --tag "codercom/enterprise-${image}:latest" "$build_id"
Comment on lines +110 to 118
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between example and enterprise?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the same it is just that we expect people to use these images even if not enterprise users

done
106 changes: 55 additions & 51 deletions scripts/scan_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,58 +103,62 @@ trivy_tmp_dir="$(mktemp -d -p "$PROJECT_ROOT")"

trap 'rm -rf "$tmp_dir" "$trivy_tmp_dir"' EXIT

PREFIXES=("example" "enterprise")

for image in "${IMAGES[@]}"; do
image_ref="codercom/enterprise-${image}:${TAG}"
image_name="${image}-${TAG}"
output="${tmp_dir}/${image}-${TAG}.sarif"

if ! docker image inspect "$image_ref" >/dev/null 2>&1; then
echo "Image '$image_ref' does not exist locally; skipping" >&2
continue
fi

old_tmpdir="${TMPDIR:-}"
export TMPDIR="$trivy_tmp_dir"

# The timeout is set to 15 minutes because in Java images it can take a while
# to scan JAR files for vulnerabilities.
run_trace $DRY_RUN trivy image \
--severity CRITICAL,HIGH \
--format sarif \
--output "$output" \
--timeout 15m0s \
"$image_ref" 2>&1 | indent

if [ "$old_tmpdir" = "" ]; then
unset TMPDIR
else
export TMPDIR="$old_tmpdir"
fi

if [ $DRY_RUN = true ]; then
continue
fi

if [ ! -f "$output" ]; then
echo "No SARIF output found for image '$image_ref' at '$output'" >&2
exit 1
fi

# Do substitutions to add extra details to every message. Without these
# substitutions, most messages won't have any information about which image
# the vulnerability was found in.
jq \
".runs[].tool.driver.name |= \"Trivy ${image_name}\"" \
"$output" >"$output.tmp"
mv "$output.tmp" "$output"
jq \
".runs[].results[].locations[].physicalLocation.artifactLocation.uri |= \"${image_name}/\" + ." \
"$output" >"$output.tmp"
mv "$output.tmp" "$output"
jq \
".runs[].results[].locations[].message.text |= \"${image_name}: \" + ." \
"$output" >"$output.tmp"
mv "$output.tmp" "$output"
for prefix in "${PREFIXES[@]}"; do
image_ref="codercom/${prefix}-${image}:${TAG}"
image_name="${prefix}-${image}-${TAG}"
output="${tmp_dir}/${prefix}-${image}-${TAG}.sarif"

if ! docker image inspect "$image_ref" >/dev/null 2>&1; then
echo "Image '$image_ref' does not exist locally; skipping" >&2
continue
fi

old_tmpdir="${TMPDIR:-}"
export TMPDIR="$trivy_tmp_dir"

# The timeout is set to 15 minutes because in Java images it can take a while
# to scan JAR files for vulnerabilities.
run_trace $DRY_RUN trivy image \
--severity CRITICAL,HIGH \
--format sarif \
--output "$output" \
--timeout 15m0s \
"$image_ref" 2>&1 | indent

if [ "$old_tmpdir" = "" ]; then
unset TMPDIR
else
export TMPDIR="$old_tmpdir"
fi

if [ $DRY_RUN = true ]; then
continue
fi

if [ ! -f "$output" ]; then
echo "No SARIF output found for image '$image_ref' at '$output'" >&2
exit 1
fi

# Do substitutions to add extra details to every message. Without these
# substitutions, most messages won't have any information about which image
# the vulnerability was found in.
jq \
".runs[].tool.driver.name |= \"Trivy ${image_name}\"" \
"$output" >"$output.tmp"
mv "$output.tmp" "$output"
jq \
".runs[].results[].locations[].physicalLocation.artifactLocation.uri |= \"${image_name}/\" + ." \
"$output" >"$output.tmp"
mv "$output.tmp" "$output"
jq \
".runs[].results[].locations[].message.text |= \"${image_name}: \" + ." \
"$output" >"$output.tmp"
mv "$output.tmp" "$output"
done
done

# Merge all SARIF files into one.
Expand Down