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

Add simple example for how to run Sagui inside a container #62

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.github/
build/
docs/
lib/
_config.yml
ChangeLog
Dockerfile
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
######################################################################
# Copyright (c) 2024 Silvio Clecio (silvioprog) <[email protected]>
#
# SPDX-License-Identifier: MIT
######################################################################

# podman build --platform linux/amd64 -t hello_sagui .
# podman run --platform linux/amd64 --rm -it -p 8080:8080 hello_sagui

FROM alpine:3.19.1 AS builder

RUN apk add --no-cache \
make \
autoconf \
automake \
clang \
cmake

WORKDIR /app

COPY . /app/

RUN mkdir build && \
cd build/ && \
cmake -DBUILD_SHARED_LIBS=OFF .. && \
make example_httpsrv
RUN strip /app/build/examples/example_httpsrv

FROM scratch
WORKDIR /app
COPY --from=builder /lib/ld-musl-x86_64.so.1 /lib/ld-musl-x86_64.so.1
COPY --from=builder /app/build/examples/example_httpsrv .
ENTRYPOINT ["./example_httpsrv", "8080"]