Skip to content

feature request: Dockerfile and .github/workflows #46

@loynoir

Description

@loynoir

feature request: Dockerfile and .github/workflows

actual

Very interesting project!

But, at first glance, I found no blog, no doc, no CI.

Thus, no idea how to audit and build this project.

Would be nice to impl Dockerfile and .github/workflows

expected

# download from vcs instead of release to prevent xz backdoor
FROM alpine AS repo
RUN git clone \
    https://github.com/oriansj/stage0 \
    /usr/src/repo

# hand written exe, must smallest enough for human audit
FROM scratch AS stage0
COPY --from=repo /usr/src/repo/stage0/exe /bin/stage0

# region stage1
FROM scratch AS build_stage1
COPY --from=stage0 /bin/stage0 /bin/stage0
COPY --from=repo /usr/src/repo/stage1 /usr/src/stage1
RUN /bin/stage0 --input /usr/src/stage1 --ouput /bin/stage1

FROM scratch AS stage1
COPY --from=build_stage1 /bin/stage1 /bin/stage0
# endregion stage1

# region stage2
FROM scratch AS build_stage2
COPY --from=stage1 /bin/stage1 /bin/stage1
COPY --from=repo /usr/src/repo/stage2 /usr/src/stage2
RUN /bin/stage1 --input /usr/src/stage2 --ouput /bin/stage2

FROM scratch AS stage2
COPY --from=build_stage2 /bin/stage2 /bin/stage1
# endregion stage2

# region stage3
FROM scratch AS build_stage3
COPY --from=stage2 /bin/stage2 /bin/stage2
COPY --from=repo /usr/src/repo/stage3 /usr/src/stage3
RUN /bin/stage2 --input /usr/src/stage3 --ouput /bin/stage3

FROM scratch AS stage3
COPY --from=build_stage3 /bin/stage3 /bin/stage2
# endregion stage3

usage

# region test
FROM scratch AS test
COPY --from=stage3 /bin/stage3 /bin/stage3
RUN /bin/stage3 --input $TINYCC_GIT_URL --ouput /bin/tcc
# endregion test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions