Skip to content

Commit

Permalink
create dockerfile that builds go binary too for onebranch ci
Browse files Browse the repository at this point in the history
  • Loading branch information
chaireez committed Oct 2, 2023
1 parent 3dfbc62 commit c58f8ff
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions pkg/blobplugin/Dockerfile.mariner
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License 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.

##############
# Build binaries
##############

ARG BUILD_IMAGE
FROM ${BUILD_IMAGE} AS build-stage

WORKDIR /app

ARG ARCH=amd64

COPY go.mod go.sum ./
RUN go mod download

ADD . .
RUN make clean && make

##############
# Build CSI container
##############

FROM mcr.microsoft.com/cbl-mariner/base/core:2.0

ARG ARCH=amd64

RUN mkdir /blobfuse-proxy/

COPY --from=build-stage /app/_output/${ARCH}/blobplugin /blobplugin
COPY --from=build-stage /app/_output/${ARCH}/blobfuse-proxy /blobfuse-proxy/
COPY --from=build-stage /app/pkg/blobfuse-proxy/init.sh /blobfuse-proxy/
COPY --from=build-stage /app/pkg/blobfuse-proxy/blobfuse-proxy.service /blobfuse-proxy/

RUN chmod +x /blobfuse-proxy/init.sh && \
chmod +x /blobfuse-proxy/blobfuse-proxy.service && \
chmod +x /blobfuse-proxy/blobfuse-proxy

RUN tdnf updateinfo && \
tdnf install -y util-linux e2fsprogs nfs-utils quota-rpc rpcbind blobfuse2 fuse3 libcap-ng libcap ca-certificates && \
tdnf clean all

LABEL maintainers="andyzhangx"
LABEL description="Azure Blob Storage CSI driver"

ENTRYPOINT ["/blobplugin"]

0 comments on commit c58f8ff

Please sign in to comment.