Skip to content

Commit

Permalink
Merge pull request #58 from koct9i/workflows
Browse files Browse the repository at this point in the history
Add Dockerfile
  • Loading branch information
koct9i authored Jan 19, 2025
2 parents fcc62bd + a215078 commit 3a6bf89
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
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

0 comments on commit 3a6bf89

Please sign in to comment.