-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from risoflora/docker
Add simple example for how to run Sagui inside a container
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.github/ | ||
build/ | ||
docs/ | ||
lib/ | ||
_config.yml | ||
ChangeLog | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |