Skip to content

Commit

Permalink
centos image
Browse files Browse the repository at this point in the history
Signed-off-by: zhangmin <[email protected]>
  • Loading branch information
min-zh committed Sep 3, 2020
1 parent 15acca9 commit 6676147
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 19 deletions.
23 changes: 6 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...
Expand Down
2 changes: 1 addition & 1 deletion deploy/neonsan/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 31 additions & 0 deletions deploy/neonsan/docker/centos/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
3 changes: 2 additions & 1 deletion deploy/neonsan/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6676147

Please sign in to comment.