From f736779fbae5962a07cfbec8d279615428349217 Mon Sep 17 00:00:00 2001 From: Daniel Ding Date: Tue, 2 Apr 2024 18:55:14 +0800 Subject: [PATCH] fix: build docker option include rhel --- Makefile | 14 +++++++------- docker/centos/Dockerfile | 5 +++-- docker/debian/Dockerfile | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 754a349..c119e00 100755 --- a/Makefile +++ b/Makefile @@ -62,8 +62,8 @@ config: builder: docker run -d -it \ - --env http_proxy="${http_proxy}" --env https_proxy="${https_proxy}" - -v $(SD)/:/opt/openlan -v $(shell echo ~)/.ssh:/root/.ssh \ + --env http_proxy="${http_proxy}" --env https_proxy="${https_proxy}" \ + --volume $(SD)/:/opt/openlan --volume $(shell echo ~)/.ssh:/root/.ssh \ --name openlan_builder debian:buster bash docker exec openlan_builder bash -c "apt update && apt install -y git lsb-release wget make gcc" docker exec openlan_builder bash -c "wget https://golang.google.cn/dl/go1.16.linux-amd64.tar.gz && tar -xf go1.16.linux-amd64.tar.gz -C /usr/local" @@ -78,17 +78,17 @@ docker-rhel: ## build image for redhat cp -rf $(SD)/docker/centos $(BD) cd $(BD) && \ sudo docker build -t luscis/openlan:$(VER).$(ARCH).el \ - --build-arg BIN=$(LIN_DIR).bin --build-arg http_proxy="${http_proxy}" --build-arg https_proxy="${https_proxy}" \ - -f centos/Dockerfile . + --build-arg linux_bin=$(LIN_DIR).bin --build-arg http_proxy="${http_proxy}" --build-arg https_proxy="${https_proxy}" \ + --file centos/Dockerfile . docker-deb: docker-bin ## build image for debian cp -rf $(SD)/docker/debian $(BD) cd $(BD) && \ sudo docker build -t luscis/openlan:$(VER).$(ARCH).deb \ - --build-arg BIN=$(LIN_DIR).bin --build-arg http_proxy="${http_proxy}" --build-arg https_proxy="${https_proxy}" \ - --build-arg BIN=$(LIN_DIR).bin -f debian/Dockerfile . + --build-arg linux_bin=$(LIN_DIR).bin --build-arg http_proxy="${http_proxy}" --build-arg https_proxy="${https_proxy}" \ + --file debian/Dockerfile . -docker: docker-deb ## build docker images +docker: docker-deb docker-rhel ## build docker images docker-builder: builder ## create a builder diff --git a/docker/centos/Dockerfile b/docker/centos/Dockerfile index 758af5d..904b059 100755 --- a/docker/centos/Dockerfile +++ b/docker/centos/Dockerfile @@ -1,6 +1,6 @@ FROM centos:7 -ARG BIN +ARG linux_bin WORKDIR /root @@ -9,7 +9,8 @@ RUN yum update -y && \ yum install -y rdma-core libibverbs ADD ${BIN} /tmp -RUN DOCKER=yes /tmp/${BIN} +RUN DOCKER=yes /tmp/${linux_bin} +RUN rm -rvf /tmp/* && yum clean dbcache LABEL application="OpenLAN Network Solutions" LABEL maintainer="danieldin95@163.com" diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 6d6f06a..1faa9fd 100755 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -1,6 +1,6 @@ FROM debian:buster -ARG BIN +ARG linux_bin WORKDIR /root @@ -8,7 +8,7 @@ WORKDIR /root RUN apt-get update -y ADD ${BIN} /tmp -RUN DOCKER=yes /tmp/${BIN} +RUN DOCKER=yes /tmp/${linux_bin} LABEL application="OpenLAN Network Solutions" LABEL maintainer="danieldin95@163.com"