From 08733e53a2474299855afdee1a1d8517034251de Mon Sep 17 00:00:00 2001 From: notch Date: Mon, 1 Feb 2021 13:59:36 +0800 Subject: [PATCH] test docker --- Dockerfile | 7 +++++++ makefile | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4bb9a38 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:latest +RUN mkdir /app +WORKDIR /app +COPY bin/docker . +# Expose ipchub ports +EXPOSE 554 +CMD ["./ipchub"] \ No newline at end of file diff --git a/makefile b/makefile index 7e44028..2d3d0e8 100755 --- a/makefile +++ b/makefile @@ -14,7 +14,13 @@ build: cp -r demos bin/ cp -r docs bin/ -# linux compilation +build-docker: + CGO_ENABLED=$(ENABLED_CGO) GOOS=linux GOARCH=amd64 $(GOBUILD) -o bin/docker/$(BINARY_NAME) -ldflags "-X github.com/cnotch/ipchub/config.Version=$(VERSION)" . + cp -r demos bin/docker/ + cp -r docs bin/docker/ + docker build -t ipchub . + rm -rf bin/docker + build-linux-amd64: CGO_ENABLED=$(ENABLED_CGO) GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_DIR)/linux/amd64/$(BINARY_NAME) -ldflags "-X github.com/cnotch/ipchub/config.Version=$(VERSION)" . cp -r demos $(BINARY_DIR)/linux/amd64/