Skip to content

Comments

Add image parameter#36

Merged
bschwedler merged 2 commits intomainfrom
add-image-param
Dec 19, 2025
Merged

Add image parameter#36
bschwedler merged 2 commits intomainfrom
add-image-param

Conversation

@bschwedler
Copy link
Contributor

@bschwedler bschwedler commented Dec 1, 2025

Add an image parameter to the action.

This simplifies running a specific image for Connect

The image must be specified with a tag (e.g. rstudio/rstudio-connect:2025.12.0) and will override the default version.
The script and action will exit with an error if both image and version are specified.

@bschwedler bschwedler force-pushed the add-image-param branch 2 times, most recently from 60cb211 to 6eab77c Compare December 1, 2025 20:48
@nealrichardson
Copy link
Collaborator

@bschwedler are you still working on this?

@bschwedler
Copy link
Contributor Author

@nealrichardson I need to complete some additional testing with cross-repository image access for internal ghcr repositories. Once this is complete, I'll mark this ready for review.

@bschwedler bschwedler force-pushed the add-image-param branch 3 times, most recently from 6b0cd86 to 0c147f1 Compare December 18, 2025 18:58
@bschwedler bschwedler marked this pull request as ready for review December 18, 2025 19:02
@bschwedler
Copy link
Contributor Author

This should be good to go now.

The following GHA run pulls from an internal GHCR repository, showing that GH org permissions allow pulling containers that were pushed from another repository.
https://github.com/posit-dev/images-examples/actions/runs/20347993740/job/58465111316

  • Action run from posit-dev/image-examples
  • Container pushed from posit-dev/images-connect

@bschwedler bschwedler force-pushed the add-image-param branch 2 times, most recently from e105eb2 to 0c6cb2d Compare December 18, 2025 19:08
This change allows specifying a custom container image for Posit Connect
Copy link
Collaborator

@nealrichardson nealrichardson left a comment

Choose a reason for hiding this comment

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

One question about the validation but otherwise this looks good to me, thanks!

main.py Outdated
base_image, tag = args.image.rsplit(":", 1)
except ValueError:
raise RuntimeError(
f"Invalid image format: '{args.image}'. Image must include a tag (e.g., rstudio/rstudio-connect:2025.09.0)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this invalid? Doesn't docker default to latest if you don't specify a tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point.

The rest of the code relies on base_image and tag being separate. I'll default to latest if the tag isn't specified and write out an info/warning message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This also moves the logic into a helper function to make it easier to
test.
@bschwedler bschwedler merged commit 20cfede into main Dec 19, 2025
3 checks passed
@bschwedler bschwedler deleted the add-image-param branch December 19, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants