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 Dockerfile #58

Merged
merged 1 commit into from
Jan 19, 2025
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
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.o
/ioping
/ioping.exe
/ucrt-spec
/bin/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
*.o
/ioping
/ioping.exe
/ucrt-spec
/bin/
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM alpine:latest as alpine-build
RUN apk --no-cache add make gcc musl-dev linux-headers
WORKDIR /src
COPY . .
RUN make static

FROM scratch AS alpine-bin
COPY --from=alpine-build /src/ioping /

###

FROM debian:latest as debian-build
RUN apt update && apt install -y --no-install-recommends make gcc libc6-dev
WORKDIR /src
COPY . .
RUN make static

FROM scratch AS debian-bin
COPY --from=debian-build /src/ioping /

###

FROM fedora:latest as fedora-build
RUN dnf install -y make gcc glibc-static
WORKDIR /src
COPY . .
RUN make static

FROM scratch AS fedora-bin
COPY --from=fedora-build /src/ioping /

###

FROM ubuntu:latest as ubuntu-build
RUN apt update && apt install -y --no-install-recommends make gcc libc6-dev
WORKDIR /src
COPY . .
RUN make static

FROM scratch AS ubuntu-bin
COPY --from=ubuntu-build /src/ioping /

###
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,7 @@ binary-zip: checkver $(PACKFILES)
zip ${PACKAGE}-${VERSION}-${TARGET}.zip $(addprefix $(DISTDIR)/,$^)
rm $(DISTDIR)

docker-build-alpine docker-build-debian docker-build-fedora docker-build-ubuntu:
docker build --target ${@:docker-build-%=%}-bin . -o bin/${@:docker-build-%=%}

.PHONY: all version checkver clean strip test install dist binary-tgz binary-zip
Loading