Skip to content

Commit

Permalink
Switch package*/Dockerfile to use git clone
Browse files Browse the repository at this point in the history
  • Loading branch information
gargnitingoogle committed Mar 7, 2024
1 parent 6bd5fbb commit f3af723
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions tools/package_gcsfuse_docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,20 @@

FROM golang:1.22.0 as builder

# Directory for creating a go module
RUN mkdir package_gcsfuse
WORKDIR $PWD/package_gcsfuse
RUN go mod init package_gcsfuse

RUN apt-get update -qq && apt-get install -y ruby ruby-dev rubygems build-essential rpm && gem install --no-document bundler

ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GO111MODULE=auto

ARG GCSFUSE_VERSION
ARG GCSFUSE_REPO="github.com/googlecloudplatform/gcsfuse"
ENV GCSFUSE_PATH "$GOPATH/pkg/mod/$GCSFUSE_REPO@v${GCSFUSE_VERSION}"
RUN go get ${GCSFUSE_REPO}@v${GCSFUSE_VERSION}
ARG GCSFUSE_REPO="https://github.com/googlecloudplatform/gcsfuse/"
ARG BRANCH_NAME="v${GCSFUSE_VERSION}"
RUN git clone --branch ${BRANCH_NAME} ${GCSFUSE_REPO}

ARG GCSFUSE_PATH=/go/gcsfuse
WORKDIR ${GCSFUSE_PATH}

ARG DEBEMAIL="gcs-fuse-maintainers@google.com"
ARG DEBFULLNAME="GCSFuse Team"

Expand All @@ -49,8 +46,8 @@ RUN if [ "${ARCHITECTURE}" != "amd64" ] && [ "${ARCHITECTURE}" != "arm64" ]; the
fi
ARG GCSFUSE_BIN="/gcsfuse_${GCSFUSE_VERSION}_${ARCHITECTURE}"
ARG GCSFUSE_DOC="${GCSFUSE_BIN}/usr/share/doc/gcsfuse"
WORKDIR ${GOPATH}
RUN go install ${GCSFUSE_REPO}/tools/build_gcsfuse@v${GCSFUSE_VERSION}
WORKDIR ${GCSFUSE_PATH}/tools/build_gcsfuse
RUN go install
RUN mkdir -p ${GCSFUSE_BIN}
RUN build_gcsfuse ${GCSFUSE_PATH} ${GCSFUSE_BIN} ${GCSFUSE_VERSION}
RUN mkdir -p ${GCSFUSE_BIN}/usr && mv ${GCSFUSE_BIN}/bin ${GCSFUSE_BIN}/usr/bin
Expand Down Expand Up @@ -90,5 +87,5 @@ RUN fpm \
--rpm-digest sha256 \
--license Apache-2.0 \
--vendor "" \
--url "https://$GCSFUSE_REPO/" \
--url "https://$GCSFUSE_REPO" \
--description "A user-space file system for Google Cloud Storage."

0 comments on commit f3af723

Please sign in to comment.