Skip to content

Commit

Permalink
Add container image building:
Browse files Browse the repository at this point in the history
Allows users to run ipxedust in a container.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Jun 19, 2022
1 parent 7548eaf commit 5bc6e25
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.17"
go-version: "1.17.5"
- name: lint
run: make lint
- name: test
Expand Down
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM golang:1.17.5 as builder

WORKDIR /code
COPY go.mod go.sum /code/
RUN go mod download

COPY . /code
RUN CGO_ENABLED=0 make build

FROM scratch

COPY --from=builder /code/bin/ipxedust-linux /ipxedust-linux
EXPOSE 69/udp
EXPOSE 8080/tcp
ENV IPXE_TFTP_SINGLE_PORT=TRUE

ENTRYPOINT ["/ipxedust-linux"]
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OSFLAG:=$(shell go env GOHOSTOS)
BINARY:=ipxe
BINARY:=ipxedust
IPXE_BUILD_SCRIPT:=binary/script/build_ipxe.sh
IPXE_NIX_SHELL:=binary/script/shell.nix

Expand Down Expand Up @@ -56,3 +56,7 @@ ifeq (${OSFLAG},linux)
else
@$(MAKE) build-darwin
endif

.PHONY: build-image
build-image: ## Build the container image
docker build -t ${BINARY}:latest .

0 comments on commit 5bc6e25

Please sign in to comment.