Skip to content

fix(docker): add sc symlink to github-actions-staging image#222

Merged
Cre-eD merged 1 commit intostagingfrom
fix/staging-dockerfile-sc-symlink
Apr 19, 2026
Merged

fix(docker): add sc symlink to github-actions-staging image#222
Cre-eD merged 1 commit intostagingfrom
fix/staging-dockerfile-sc-symlink

Conversation

@Cre-eD
Copy link
Copy Markdown
Contributor

@Cre-eD Cre-eD commented Apr 19, 2026

Problem

After #221 merged main into staging, build-staging.yml rebuilt the simplecontainer/github-actions:staging Docker image, but PAY-SPACE deploys are still failing with the same error:

/bin/sh: sc: not found
error: exit status 127: running "... 'sc' 'image' 'scan' ..."
error: exit status 127: running "... 'sc' 'sbom' 'generate' ..."
error: exit status 127: running "... 'sc' 'image' 'sign' ..."

Root cause

The production Dockerfile github-actions.Dockerfile has this line:

ln -s /root/github-actions /usr/local/bin/sc

…and verifies it with test -L /usr/local/bin/sc && test -x /usr/local/bin/sc.

The staging Dockerfile github-actions-staging.Dockerfile (which build-staging.yml builds from) does not — so :staging images ship the github-actions binary at /root/github-actions but no sc in PATH. When the security pipeline shells out to sc image sign/scan, sc sbom generate, sc provenance attach from Pulumi's local.Command, the shell can't find sc.

The two Dockerfiles drifted at some point — the production one was updated when the security pipeline landed, the staging one wasn't.

Fix

Add the sc symlink and the build-time verification to github-actions-staging.Dockerfile, mirroring the production file exactly. This keeps the two in sync going forward.

Test plan

  • Merge triggers build-staging.yml → new :staging image pushed
  • Re-run a failing PAY-SPACE deploy (e.g. https://github.com/PAY-SPACE/neural-api/actions) — security pipeline all green
  • Verify in image: docker run --rm --entrypoint sh simplecontainer/github-actions:staging -c 'which sc && sc --help | head -3'

The staging Dockerfile was missing the /usr/local/bin/sc -> github-actions
symlink that the production Dockerfile (github-actions.Dockerfile) has.
This causes 'sc: not found' when the security pipeline shells out to the
SC CLI (sc image sign, sc image scan, sc sbom generate, etc.) via Pulumi
local.Command from within the GitHub Action container.

PR #221 merged main into staging to get the security pipeline code on
staging, but the :staging image built from this Dockerfile still lacks
the symlink — so downstream PAY-SPACE deploys still fail with the same
error.

Mirrors the symlink line and the build-time verification (test -L / -x)
from github-actions.Dockerfile so the two Dockerfiles stay in sync.
@Cre-eD Cre-eD merged commit 6ea3788 into staging Apr 19, 2026
1 check passed
Cre-eD added a commit that referenced this pull request Apr 19, 2026
PR #222 added the sc symlink to this Dockerfile on the staging branch,
but push.yaml (triggered on push to main) also builds and pushes
simplecontainer/github-actions:staging using MAIN's copy of this file.

When any main push triggers push.yaml, it overwrites the :staging image
with a build that doesn't include the symlink — reintroducing
'sc: not found' on downstream deploys (e.g. PAY-SPACE/crypto-tools at
2026-04-19T20:02, right after PR #223 merged to main and re-triggered
push.yaml).

Root cause: two workflows publish the same tag from two branches. Fix
keeps the Dockerfiles in sync by applying the same symlink+verify lines
to main's copy. Mirror of #222 exactly.
Cre-eD added a commit that referenced this pull request Apr 19, 2026
…image

Brings into staging:
- PR #223 (trivy cache isolation, 0.70.0 bump, multi-image report heading)
- AWS tags, cloudflare worker fix, Caddy preStop drain, etc.

Conflicts (4 files):
- trivy.go, trivy_test.go, security_report.go: take main (new features)
- simple_container.go: KEEP staging's serviceSpec() helper + serviceTypeStr
  (main regresses here — inline ServiceSpecArgs lacks ClusterIP guard that
  codex flagged as a P1 during PR #221 review)

Triggers build-staging.yml to publish a :staging image with staging's
fixed Dockerfile (sc symlink from PR #222) AND main's improvements.

Note: this is a TEMPORARY fix. PR #224 (still in review) fixes the root
cause — main's github-actions-staging.Dockerfile. Until that merges,
every push to main re-overwrites :staging with a broken image and this
merge must be repeated.
Cre-eD added a commit that referenced this pull request Apr 19, 2026
…staging with sc symlink (#225)

## Why now

`:staging` image is currently broken (`/bin/sh: sc: not found` on
PAY-SPACE/crypto-tools). Root cause in #224 (main's Dockerfile also
needs the symlink). Until that merges, we can unblock PAY-SPACE by
re-triggering `build-staging.yml` — which builds from **staging's**
Dockerfile (already fixed by #222).

This PR takes the opportunity to also pull main's improvements into
staging so the rebuilt image includes:
- PR #223 — trivy cache isolation, 0.70.0 bump, multi-image report
heading
- Misc main commits (AWS tags, Caddy preStop drain, cloudflare worker
fix, etc.)

## Conflict resolution (4 files)

| File | Taken | Why |
|---|---|---|
| `pkg/security/scan/trivy.go` | main | New cache-isolation + 0.70.0
version bump |
| `pkg/security/scan/trivy_test.go` | main | Updated tests for
per-invocation cache dir |
| `pkg/clouds/pulumi/docker/security_report.go` | main | Multi-image
heading fix |
| `pkg/clouds/pulumi/kubernetes/simple_container.go` | **staging** |
Keep `serviceSpec()` helper + `serviceTypeStr` — main inline regresses
on ClusterIP guard (was P1 in #221 codex review) |

## Verification

- `go build ./...` clean
- `go test ./pkg/security/scan/... ./pkg/clouds/pulumi/kubernetes/...
./pkg/clouds/pulumi/docker/...` all green

## Test plan

- [ ] Merge triggers `build-staging.yml`
- [ ] `docker pull simplecontainer/github-actions:staging && docker run
--rm --entrypoint sh ... -c 'which sc'` returns `/usr/local/bin/sc`
- [ ] Re-run PAY-SPACE/crypto-tools deploy — passes

## Follow-up

Still need **PR #224** (main's Dockerfile fix) to merge — otherwise the
next push to main will overwrite `:staging` with a broken image again.

---------

Co-authored-by: universe-ops <177390656+universe-ops@users.noreply.github.com>
Co-authored-by: Universe Ops <universe-ops@github.com>
Co-authored-by: simple-container-forge[bot] <257785999+simple-container-forge[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Ilya <smecsia@gmail.com>
Co-authored-by: Bao Tran <baotn166@users.noreply.github.com>
Cre-eD added a commit that referenced this pull request Apr 20, 2026
…le (root cause of repeated :staging regressions) (#224)

## Symptom

After #221 merged main→staging and #222 added the sc symlink to
staging's Dockerfile, PAY-SPACE deploys briefly worked. Then #223 merged
to main and immediately after, PAY-SPACE/crypto-tools started failing
again with:

```
/bin/sh: sc: not found
error: exit status 127: running "... 'sc' 'sbom' 'generate' ..."
```

## Root cause

**Two separate workflows build and push
`simplecontainer/github-actions:staging`:**

| Workflow | Trigger | Dockerfile (from which branch) |
|---|---|---|
| `build-staging.yml` | push to `staging` |
`github-actions-staging.Dockerfile` on `staging` branch |
| `push.yaml` | push to `main` | `github-actions-staging.Dockerfile` on
`main` branch |

PR #222 only fixed the Dockerfile on **staging**. The main branch copy
never got the `ln -s /root/github-actions /usr/local/bin/sc` line. So
every time anything merges to main, `push.yaml` runs, builds without the
symlink, and **overwrites** the good `:staging` image that was pushed by
`build-staging.yml`.

Verified by `docker pull simplecontainer/github-actions:staging &&
docker run --rm --entrypoint sh .../github-actions:staging -c 'ls -la
/usr/local/bin/sc'`:
```
ls: /usr/local/bin/sc: No such file or directory
```

Image created timestamp matches `push.yaml` run at 19:47 (after PR #223
merged at 19:47), not `build-staging.yml` run at 17:53 (after #222).

## Fix

Apply the identical symlink + verify lines to main's copy of
`github-actions-staging.Dockerfile`. Both workflows now produce an image
with `sc` in PATH. This keeps the two Dockerfiles in sync going forward.

## Long-term

Two workflows publishing the same tag from two branches is fragile —
whichever runs last wins. Consider consolidating: either
`build-staging.yml` is the sole publisher of `:staging`, or `push.yaml`
drops the staging tag. Out of scope for this PR.

## Test plan

- [ ] Merge triggers `push.yaml` → new `:staging` image pushed
- [ ] `docker pull simplecontainer/github-actions:staging && docker run
--rm --entrypoint sh ... -c 'sc --help | head -1'` succeeds
- [ ] Re-run PAY-SPACE/crypto-tools deploy — passes end-to-end
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