fix: add dockerfile for building locally

This commit is contained in:
wencaiwulue
2022-10-29 12:49:58 +08:00
parent c4ee50e35e
commit 75684a307b
5 changed files with 43 additions and 2 deletions

View File

@@ -34,6 +34,9 @@ kubevpn-linux-amd64 kubevpn-linux-386 kubevpn-linux-arm64
.PHONY: all-image .PHONY: all-image
all-image: image image-mesh image-control-plane all-image: image image-mesh image-control-plane
.PHONY: all-image-local
all-image-local: image-local image-mesh-local image-control-plane-local
.PHONY: kubevpn .PHONY: kubevpn
kubevpn: kubevpn:
make $(TARGET) make $(TARGET)
@@ -98,3 +101,21 @@ image-control-plane:
docker push $(REGISTRY)/envoy-xds-server:${VERSION} docker push $(REGISTRY)/envoy-xds-server:${VERSION}
docker push $(REGISTRY)/envoy-xds-server:latest docker push $(REGISTRY)/envoy-xds-server:latest
############################ build local
.PHONY: image-local
image-local: kubevpn-linux-amd64
docker build -t $(REGISTRY)/kubevpn:${VERSION} -f $(BUILD_DIR)/server/local.Dockerfile .
docker tag $(REGISTRY)/kubevpn:${VERSION} $(REGISTRY)/kubevpn:latest
docker push $(REGISTRY)/kubevpn:${VERSION}
.PHONY: image-mesh-local
image-mesh-local:
docker build -t $(REGISTRY)/kubevpn-mesh:${VERSION} -f $(BUILD_DIR)/mesh/local.Dockerfile .
docker tag $(REGISTRY)/kubevpn-mesh:${VERSION} $(REGISTRY)/kubevpn-mesh:latest
docker push $(REGISTRY)/kubevpn-mesh:${VERSION}
.PHONY: image-control-plane-local
image-control-plane-local:
docker build -t $(REGISTRY)/envoy-xds-server:${VERSION} -f $(BUILD_DIR)/control_plane/local.Dockerfile .
docker tag $(REGISTRY)/envoy-xds-server:${VERSION} $(REGISTRY)/envoy-xds-server:latest
docker push $(REGISTRY)/envoy-xds-server:${VERSION}

View File

@@ -0,0 +1,10 @@
FROM ubuntu:latest
RUN sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list \
&& sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt-get clean && apt-get update && apt-get install -y wget dnsutils vim curl \
net-tools iptables iputils-ping lsof iproute2 tcpdump
WORKDIR /app
COPY bin/envoy-xds-server /bin/envoy-xds-server

View File

@@ -0,0 +1,10 @@
FROM ubuntu:latest
RUN sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list \
&& sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt-get clean && apt-get update && apt-get install -y wget dnsutils vim curl \
net-tools iptables iputils-ping lsof iproute2 tcpdump
WORKDIR /app
COPY bin/kubevpn-linux-amd64 /usr/local/bin/kubevpn

View File

@@ -6,7 +6,7 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/wencaiwulue/kubevpn/tun" "github.com/wencaiwulue/kubevpn/pkg/tun"
) )
func main() { func main() {

View File

@@ -6,7 +6,7 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/wencaiwulue/kubevpn/tun" "github.com/wencaiwulue/kubevpn/pkg/tun"
) )
func main() { func main() {