act: "sudo: command not found" in micro image
Why is the ubuntu-latest
container claiming that sudo
doesn’t exist? It kind of has to in order to run installers.
slname: CI-CD
on:
push:
branches:
- master
jobs:
tex:
name: Installing TeX Live and ((Xe)La)TeX related packages
runs-on: ubuntu-latest
shell: bash
steps:
- name: Installing TeX Live
run: |
sudo apt-get update
This crashes, even though it never should:
[ci.yml/Installing TeX Live and ((Xe)La)TeX related packages] �🚀 Start image=node:12.6-buster-slim
[ci.yml/Installing TeX Live and ((Xe)La)TeX related packages] �🐳 docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[ci.yml/Installing TeX Live and ((Xe)La)TeX related packages] ⭐ Run Installing TeX Live
| /github/workflow/0: line 2: sudo: command not found
[ci.yml/Installing TeX Live and ((Xe)La)TeX related packages] ❌ Failure - Installing TeX Live
Error: exit with `FAILURE`: 127
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 23
- Comments: 20 (6 by maintainers)
Commits related to this issue
- Try to work with act as well as github actions Link: https://github.com/nektos/act/issues/269#issuecomment-875976242 — committed to wiktor-k/org-test by wiktor-k 10 months ago
The issue is still prevalent and prohibits running many actions.
+1; installing the
sudo
package is also not required on the actual Github Actions. I currently work around this by doingapt update && apt install sudo
prior to my regular workflow, just for act to run without this initial failure.I’m having this problem too. Can it be reopened? @nektos
Using the
apt update && apt install sudo
workaround doesn’t seem to work anymore:We still have #107 open that is pinned so people should see it easily, marking it as duplicate since main discussion is in #107
given that the main problem is that
sudo
is no preinstalled, which takes up near as makes no difference literally no space at all, I’d much rather seesudo
added to the base package. Anything else, we can install ourselves, but either the image has “root perms for everything” so that no su permissions are needed, or it comes with the few kb worth of sudo preinstalled so that things just work. Heck, even on a full perms image,sudo
should exist and just do nothing special. It’s not an optional command, too much relies on it merely existing =)I just add it as the first step:
Just reviving this a little since I also came across the issue today. And found that the updated workaround can be to just use conditional ie- if running act locally vs Github Actions cloud.
Note you may still need to install sudo package for Github Actions.