Failed to run job about docker action #63
Labels
No Label
kind
bug
kind
build
kind/compatible
kind
dependencies
kind
docs
kind
enhancement
kind
feature
kind
help wanted
kind
proposal
kind
refactor
related
act
related
environment
related
exec
related
gitea
related
workflow
reviewed
confirmed
reviewed
duplicate
reviewed
invalid
reviewed
needs feedback
reviewed
wontfix
reviewed
workaround
No Milestone
No Assignees
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/act_runner#63
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
example yml
act_runner log
There is no docker installed in the ubuntu-latest the default image. You need to install docker as first step.
I created an quick and dirty action that installs the docker-ce-cli package for you.
But this is really a communication/documentation issue. The post announcing this feature links directly to the github documentation page. Following examples there people will hit at least two pitfalls:
Execution base images are not same. This can cause many runtime errors when attempting to use community actions, though subtle actions on github are actually executed in Ubuntu based images. This runner will execute in debian based images.
Using actions from the github marketplace is possible but the names have to be prefixed with
https://github.com
ie my published docker install action:https://github/papodaca/install-docker-action@v1
It is actually really weird that for this runner
ubuntu-latest
means debian buster. I understand why this is, the project this was forked from used that execution image as well.Yeah, act_runner use
node:16-bullseye
as default container, so need to install docker in steps.And appoint container can work also, like
I am wondering if it's necessary to have the default container support docker like github runner, although the size has increased, for example
catthehacker/ubuntu:act-latest
the size1.15GB
, andnode:16-bullseye
the size941MB
The 200MB gap seems acceptable
Alternatively, if you don't want to install docker every time your action runs, you can build your own runner image.
To do so, I used catthehacker's ubuntu image and installed docker on top of it using the following Dockerfile:
Build and tag the image. I used my own private container registry to store the image but it should be possible to just leave the image locally on the machine that your gitea
act_runner
executable lives on.The resulting image has a size of ~2.3GB. If you're concerned about image size you can, instead of using catthehacker's image as base, use any container image (e.g. debian) and you even should be able to simply use one of docker's docker containers as runner image right away, but I did not test this.
After running the
act_runner
executable for the first time, there is a.runner
file in the same directory that the executable is in.Inside this file you'll find an array called
labels
.Add a new label (in my case
ci-docker
) and specify your image like seen below and restart the executable.In Gitea admin panel add the label name you just specified in the
.runner
file to your runner as a custom label. The runner you add this label to has to have access to the image you just built.You can now use the image in your workflows referencing the custom label in the
runs-on
key:Is there any reason why docker isn't installed by default in the ubuntu-latest image? It seems you want to try to be similar to GitHub actions, and the resources I found when looking up this issue mentioned that docker is installed by default on the ubuntu image. Seems logical to make the image as close as possible as well to promote the transfer-ability of GitHub actions to Gitea actions.
We just hope to use a small image to run jobs, not everyone likes waiting to download big images. See also https://github.com/nektos/act#runners
It seems you have found the cause of the problem, so I will close this issue.
Feel free to reopen it if you have any other questions.
I agree with your opinion. Further more, you could offer different runner image choices, for example standard image containers git and docker as default one, and slimmer image which doesn't. Experts would be left with choices for their own, if size does matters.