Merge pull request #28 from cmacrae/better_docker_image
image: Provide a better built container image
This commit is contained in:
commit
e31e483037
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@ -35,7 +35,7 @@ jobs:
|
|||||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||||
|
|
||||||
- name: Get the current tag name
|
- name: Get the current tag name
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" | sed 's/\//_/g' >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Setup QEMU
|
- name: Setup QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|||||||
@ -1,18 +1,21 @@
|
|||||||
FROM amd64/golang:1.16-alpine as builder
|
FROM amd64/golang:1.16-alpine as builder
|
||||||
RUN apk add git go g++
|
|
||||||
|
|
||||||
RUN mkdir -p /go/src/github.com/chrislusf/
|
RUN apk add git go g++ curl jq
|
||||||
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs
|
|
||||||
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed && go install
|
|
||||||
|
|
||||||
RUN mkdir -p /go/src/github.com/seaweedfs/
|
WORKDIR /
|
||||||
RUN git clone https://github.com/seaweedfs/seaweedfs-csi-driver /go/src/github.com/seaweedfs/seaweedfs-csi-driver
|
|
||||||
RUN cd /go/src/github.com/seaweedfs/seaweedfs-csi-driver && go build -o /seaweedfs-csi-driver ./cmd/seaweedfs-csi-driver/main.go
|
RUN curl -sL \
|
||||||
|
$(curl -s https://api.github.com/repos/chrislusf/seaweedfs/releases/latest \
|
||||||
|
| jq -r '.assets[]|select(.name=="linux_amd64.tar.gz")|.browser_download_url') \
|
||||||
|
| tar xzvf -
|
||||||
|
|
||||||
|
COPY ../../ /src
|
||||||
|
RUN cd /src && go build -o /seaweedfs-csi-driver ./cmd/seaweedfs-csi-driver/main.go
|
||||||
|
|
||||||
FROM alpine AS final
|
FROM alpine AS final
|
||||||
RUN apk add fuse
|
RUN apk add fuse
|
||||||
LABEL author="Chris Lu"
|
LABEL author="Chris Lu"
|
||||||
COPY --from=builder /go/bin/weed /usr/bin/
|
COPY --from=builder /weed /usr/bin/
|
||||||
COPY --from=builder /seaweedfs-csi-driver /
|
COPY --from=builder /seaweedfs-csi-driver /
|
||||||
|
|
||||||
RUN chmod +x /seaweedfs-csi-driver
|
RUN chmod +x /seaweedfs-csi-driver
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user