test docker

This commit is contained in:
notch
2021-02-01 13:59:36 +08:00
parent c9457fba7d
commit 08733e53a2
2 changed files with 14 additions and 1 deletions

7
Dockerfile Normal file
View File

@@ -0,0 +1,7 @@
FROM alpine:latest
RUN mkdir /app
WORKDIR /app
COPY bin/docker .
# Expose ipchub ports
EXPOSE 554
CMD ["./ipchub"]

View File

@@ -14,7 +14,13 @@ build:
cp -r demos bin/ cp -r demos bin/
cp -r docs 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: 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)" . 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/ cp -r demos $(BINARY_DIR)/linux/amd64/