diff --git a/Makefile b/Makefile index 8f9d4b7..73cfb70 100644 --- a/Makefile +++ b/Makefile @@ -17,33 +17,22 @@ .PHONY: all disk IMAGE=csiplugin/csi-neonsan -TAG=v1.2.0-rc2 +TAG=canary IMAGE_UBUNTU=csiplugin/csi-neonsan-ubuntu -TAG_UBUNTU=v1.2.0 -RELEASE_VERSION=v1.2.0 +TAG_UBUNTU=canary +IMAGE_CENTOS=csiplugin/csi-neonsan-centos +TAG_CENTOS=canary ROOT_PATH=$(pwd) PACKAGE_LIST=./cmd/... ./pkg/... -neonsan-plugin: - go build -ldflags "-w -s" -mod=vendor -o deploy/neonsan/plugin/neonsan-plugin ./cmd/neonsan - -neonsan-plugin-debug: - go build -gcflags "all=-N -l" -mod=vendor -o deploy/neonsan/plugin/neonsan-plugin-debug ./cmd/neonsan - container: docker build -t ${IMAGE}:${TAG} -f deploy/neonsan/docker/Dockerfile . container-ubuntu: docker build -t ${IMAGE_UBUNTU}:${TAG_UBUNTU} -f deploy/neonsan/docker/ubuntu/Dockerfile . -yaml: - kustomize build deploy/neonsan/kubernetes/base > deploy/neonsan/kubernetes/release/csi-neonsan-${RELEASE_VERSION}.yaml - -yaml-ubuntu: - kustomize build deploy/neonsan/kubernetes/base-ubuntu > deploy/neonsan/kubernetes/release/csi-neonsan-${RELEASE_VERSION}-ubuntu.yaml - -release: - cp deploy/neonsan/plugin/* deploy/neonsan/kubernetes/release && cd deploy/neonsan/kubernetes/ && tar -zcvf csi-neonsan-${RELEASE_VERSION}.tar.gz release/* +container-centos: + docker build -t ${IMAGE_CENTOS}:${TAG_CENTOS} -f deploy/neonsan/docker/centos/Dockerfile . mod: go build ./... diff --git a/deploy/neonsan/docker/Dockerfile b/deploy/neonsan/docker/Dockerfile index 72f75f9..93e8023 100644 --- a/deploy/neonsan/docker/Dockerfile +++ b/deploy/neonsan/docker/Dockerfile @@ -22,7 +22,7 @@ RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=vendor -ldflags "-s -w" -o _outp FROM gcr.azk8s.cn/google_containers/debian-base:v1.0.0 LABEL maintainers="Yunify" LABEL description="NeonSAN CSI plugin" -RUN clean-install util-linux e2fsprogs xfsprogs mount ca-certificates udev +RUN clean-install util-linux e2fsprogs xfsprogs mount ca-certificates udev COPY --from=builder /qingstor-csi/_output/neonsan-csi-driver /neonsan-csi-driver RUN chmod +x /neonsan-csi-driver && \ mkdir -p /var/log/neonsan-csi-driver diff --git a/deploy/neonsan/docker/centos/Dockerfile b/deploy/neonsan/docker/centos/Dockerfile new file mode 100644 index 0000000..acf5918 --- /dev/null +++ b/deploy/neonsan/docker/centos/Dockerfile @@ -0,0 +1,31 @@ +# +------------------------------------------------------------------------- +# | Copyright (C) 2018 Yunify, Inc. +# +------------------------------------------------------------------------- +# | Licensed under the Apache License, Version 2.0 (the "License"); +# | you may not use this work except in compliance with the License. +# | You may obtain a copy of the License in the LICENSE file, or at: +# | +# | http://www.apache.org/licenses/LICENSE-2.0 +# | +# | Unless required by applicable law or agreed to in writing, software +# | distributed under the License is distributed on an "AS IS" BASIS, +# | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# | See the License for the specific language governing permissions and +# | limitations under the License. +# +------------------------------------------------------------------------- + +FROM golang:1.12.7-alpine as builder +WORKDIR /qingstor-csi +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=vendor -ldflags "-s -w" -o _output/neonsan-csi-driver ./cmd/neonsan + +FROM centos:7 +LABEL maintainers="Yunify" +LABEL description="NeonSAN CSI plugin" +# libcurl3 and libicu55 for qbd +RUN yum -y install libcurl libicu +RUN yum -y install e2fsprogs xfsprogs mount ca-certificates udev +COPY --from=builder /qingstor-csi/_output/neonsan-csi-driver /neonsan-csi-driver +RUN chmod +x /neonsan-csi-driver && \ + mkdir -p /var/log/neonsan-csi-driver +ENTRYPOINT ["/neonsan-csi-driver"] \ No newline at end of file diff --git a/deploy/neonsan/docker/ubuntu/Dockerfile b/deploy/neonsan/docker/ubuntu/Dockerfile index 81663fd..6ee56ee 100644 --- a/deploy/neonsan/docker/ubuntu/Dockerfile +++ b/deploy/neonsan/docker/ubuntu/Dockerfile @@ -24,7 +24,8 @@ LABEL maintainers="Yunify" LABEL description="NeonSAN CSI plugin" # libcurl3 and libicu55 for qbd RUN apt-get update -y && \ - apt-get install -y libcurl3 libicu55 + apt-get install -y libcurl3 libicu55 && \ + apt-get install -y e2fsprogs xfsprogs mount ca-certificates udev COPY --from=builder /qingstor-csi/_output/neonsan-csi-driver /neonsan-csi-driver RUN chmod +x /neonsan-csi-driver && \ mkdir -p /var/log/neonsan-csi-driver