Replies: 8 comments 2 replies
-
Not sure where this new keyword should be added? |
Beta Was this translation helpful? Give feedback.
-
|
This feature is great - we hope to use it for dependabot accessing registries with self-signed certs. update for clarification: the custom image is the basic ubuntu-latest + some certificate files ;-) so no 8k movies included. Total size is shown as "0 GB". |
Beta Was this translation helpful? Give feedback.
-
|
Is it possible to create a custom image with hard-coded / baked-in environment variables so that the workflow runs using this image will automatically have those environment variables set? Our use case: dependabot needs to connect to an artifact repo with self-signed certs. We want to create a custom image with those self-signed certs and the environment variable "NODE_EXTRA_CA_CERTS" set so that the official dependabot action picks those up. We'd like to do something like dependabot/dependabot-core#6160 (comment) but with GH hosted runners and hoped that the custom image feature would make this possible. |
Beta Was this translation helpful? Give feedback.
-
|
I am trying to optionally support setting snapshot in my workflow templates Essentially by default I want no snapshot, but at times I would like it to be settable. Currently it seems that this is not possible, as when snapshot is set, it does not support a null or empty value e.g. ends up with "Required property is missing: image-name" while or end up with syntax errors Is this possible somehow? |
Beta Was this translation helpful? Give feedback.
-
|
Anecdotally speaking it appears by workflows do steps which take a long time in a quicker fashion now (e..g. azure/login@v2 seems quicker) E.g. I would expect these steps to be redundant |
Beta Was this translation helpful? Give feedback.
-
|
Can't get it to work. Any generated custom images do not show up for me in Organization / Enterprise custom images pages, so there is no information about if custom images have been generated. They just state There are no custom images available. I assume visibility of unsuccesful snapshot processes will be introduced during the preview. I triggered it on a windows-2025 larger runner, and the action log says that it has sent the request. |
Beta Was this translation helpful? Give feedback.
-
|
The steps I followed to get Custom image generation working:
name: Build custom image
on:
push:
branches:
- main
paths:
- ".github/workflows/build-custom-image.yml"
jobs:
build-custom-image:
name: Build custom image
runs-on: generator # <-- THIS POINTS TO THE RUNNER VM WITH THE CUSTOM IMAGE GENERATION ENABLED
snapshot: custom-image # <-- THIS IS THE NAME OF THE GENERATED CUSTOM IMAGE ONCE THIS WORKFLOW PASSES
# Do something here, install stuff, etc. These should be preserved in the generated image
# so that other workflows using the generated image do not have to install the stuff again.
steps:
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24.3.0"
name: Use custom image
on:
push:
branches:
- main
paths:
- ".github/workflows/use-custom-image.yml"
jobs:
use-custom-image:
name: Use custom image
runs-on: custom-image-8core # <-- THIS POINTS TO THE NEW RUNNER IMAGE THAT USES THE custom-image SNAPSHOT
steps:
- name: Do something useful
run: node --version # should print 24.3.0?This is how I understood it works, and got the custom image running in a workflow. Not sure about the details though, and AI tools like Claude Code offer no help as the feature is so new. Good luck! |
Beta Was this translation helpful? Give feedback.
-
|
That's a really interesting update! It sounds like a fantastic way to streamline workflows and improve security and cost-efficiency on GitHub. The ability to pre-install all the necessary tools and dependencies is a huge time saver, and the lifecycle management features seem really valuable for maintaining a secure and compliant environment. I especially like the emphasis on enterprise-grade customization. Thanks for sharing this! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Custom images for GitHub-hosted runners are now available in public preview. This feature allows you to start with a GitHub-curated base image and build your own virtual machine image tailored to your workflow needs.
Custom images can include your repository code, prepulled container images, required binaries, certificates, and other dependencies. Developers benefit from:
How to get started
Custom images let you define exactly what your GitHub Actions runner environment looks like, so every workflow starts with the tools, dependencies, and configurations you need already in place. Here’s how to get started:
1. Create a larger runner that can generate custom images.
Begin by setting up a runner capable of building custom images. This runner uses a base image (either a GitHub partner image or one you’ve already generated) as the foundation for your new image. This layered approach lets you build on trusted environments and add only what you need.
2. Run an image-generating workflow.
In your workflow file, add a new
snapshottype to your job. This tells GitHub Actions to capture the state of your runner after installing all required tools and packages.3. Add your runner to a runner group with the custom image.
Once your image is built, a larger runner uses it and is then assigned to a runner group. Runners already using the named image will automatically pick up new versions of the image. In your workflows, you still need to reference the runner or runner group name—you cannot target runners solely by the image name. All subsequent workflow runs using this runner will start with your custom environment, saving time and ensuring consistency. Please allow 10-15 minutes after the image has been created before the new version is ready to use.
4. Use your custom image in future workflows.
To use your custom image, set the
runs-ontarget in your workflow to the name of the runner (or runner group with a runner) using the custom image. Every job will start with your dependencies preinstalled, so you can focus on building and shipping faster.Learn more
For detailed instructions, advanced configuration options, and troubleshooting tips, see our official documentation on managing larger runners. You’ll find step-by-step guides, workflow examples, and best practices for using custom images with GitHub-hosted runners.
🌟Leave a comment!
Join the discussion and leave feedback in the comments below!
Disclaimer: The UI for features in public preview is subject to change.
Beta Was this translation helpful? Give feedback.
All reactions