Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong overriding of container entry point #455

Merged
merged 19 commits into from
Mar 10, 2024
Merged
31 changes: 17 additions & 14 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,29 @@ jobs:
[ -n "$container_name" ] # May be fail with bg timing
podman exec --user=user -it "$container_name" /provisioner/needs_systemd.bash
podman exec --user=root -it "$container_name" rm -rf /provisioner/cleanup.bash
podman commit "$container_name" ran-nix-commands-by-user
podman commit "$container_name" home
podman kill "$container_name"
podman tag home latest
podman tag home ${{ github.sha }}
podman tag home ${{ needs.get-meta.outputs.started_at }}
- name: Test output image
run: |
set -euxo pipefail
podman run --rm home &
sleep 1
container_name="$(podman ps --sort=created --format '{{.Names}}' | tail -1)"
[ -n "$container_name" ]
podman exec --user=user --workdir='/home/user' -it "$container_name" '/home/user/.nix-profile/bin/zsh' -c la
podman kill "$container_name"
- name: Finalize the image
id: build-image
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 #v2.13
with:
image: home
base-image: ran-nix-commands-by-user
tags: latest ${{ github.sha }} ${{ needs.get-meta.outputs.started_at }}
oci: true
- name: Push To ghcr.io
# if: ${{ github.event_name != 'pull_request' }}
id: push-to-ghcr
if: ${{ github.event_name != 'pull_request' }}
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c #v2.8
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}
# Keep 1 line with space delimiter with the action spec
tags: ghcr.io/${{ github.repository_owner }}/home:latest ghcr.io/${{ github.repository_owner }}/home:${{ github.sha }} ghcr.io/${{ github.repository_owner }}/home:${{ needs.get-meta.outputs.started_at }}
Copy link
Owner Author

Choose a reason for hiding this comment

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

Error: error normalizing name "20240309-053713-UTC": error normalizing name "20240309-053713-UTC": repository name must be lowercase

need here https://github.com/orgs/community/discussions/25768

username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Log pushed outputs
if: ${{ github.event_name != 'pull_request' }}
# if: ${{ github.event_name != 'pull_request' }}
run: echo "${{ toJSON(steps.push-to-ghcr.outputs) }}"
4 changes: 2 additions & 2 deletions containers/sandbox-with-ghcr.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ sandbox() {
podman pull ghcr.io/kachick/home:latest
podman run --rm ghcr.io/kachick/home:latest &
sleep 1
container_name="$(podman ps --sort=created --format '{{.Names}}' | tail -1)"
local -r container_name="$(podman ps --sort=created --format '{{.Names}}' | tail -1)"
[ -n "$container_name" ]
podman exec --user=user --workdir='/home/user' -it "$container_name" /home/user/.nix-profile/bin/zsh
podman exec --user=user --workdir='/home/user' -it "$container_name" '/home/user/.nix-profile/bin/zsh'
podman kill "$container_name"
}

Expand Down
2 changes: 1 addition & 1 deletion containers/sandbox.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sandbox() {
sleep 1
local -r container_name="$(podman ps --sort=created --format '{{.Names}}' | tail -1)"
[ -n "$container_name" ]
podman exec --user=user --workdir='/home/user' -it "$container_name" /home/user/.nix-profile/bin/zsh
podman exec --user=user --workdir='/home/user' -it "$container_name" '/home/user/.nix-profile/bin/zsh'
podman kill "$container_name"
}

Expand Down
Loading