forked from kubernetes-sigs/blob-csi-driver
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
83 lines (66 loc) · 3.53 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# 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.
ARG ARCH=amd64
FROM registry.k8s.io/build-image/debian-base:bookworm-v1.0.4 AS base
FROM base AS builder
ARG ARCH
RUN apt update \
&& apt install -y curl
# install aznfs
ARG aznfsVer=2.0.7
RUN if [ "$ARCH" = "arm64" ]; then \
curl -Ls https://github.com/Azure/AZNFS-mount/releases/download/${aznfsVer}/aznfs-${aznfsVer}-1.arm64.tar.gz | tar xvzf - -C / --keep-directory-symlink; \
else \
curl -Ls https://github.com/Azure/AZNFS-mount/releases/download/${aznfsVer}/aznfs-${aznfsVer}-1.x86_64.tar.gz | tar xvzf - -C / --keep-directory-symlink; \
fi
# install azcopy
RUN curl -Ls https://azcopyvnext-awgzd8g7aagqhzhe.b02.azurefd.net/releases/release-10.27.1-20241113/azcopy_linux_${ARCH}_10.27.1.tar.gz \
| tar xvzf - --strip-components=1 -C /usr/local/bin/ --wildcards "*/azcopy"
# download blobfuse deb
RUN mkdir /blobfuse-proxy/
RUN curl -Lso /blobfuse-proxy/packages-microsoft-prod-18.04.deb https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
RUN curl -Lso /blobfuse-proxy/packages-microsoft-prod-22.04.deb https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
FROM base
ARG ARCH
ARG binary=./_output/${ARCH}/blobplugin
COPY ${binary} /blobplugin
COPY --from=builder --chown=root:root /opt/microsoft/aznfs /opt/microsoft/aznfs
COPY --from=builder --chown=root:root /sbin/mount.aznfs /sbin/mount.aznfs
COPY --from=builder --chown=root:root /usr/sbin/aznfswatchdog /usr/sbin/aznfswatchdog
COPY --from=builder --chown=root:root /usr/local/bin/azcopy /usr/local/bin/azcopy
COPY --from=builder --chown=root:root /blobfuse-proxy /blobfuse-proxy
# packages that are only needed by aznfs: procps conntrack iptables bind9-host iproute2 bash netcat sysvinit-utils.
RUN apt update && apt upgrade -y && apt-mark unhold libcap2 && clean-install ca-certificates uuid-dev util-linux mount udev e2fsprogs nfs-common netbase procps conntrack iptables bind9-host iproute2 bash netcat-traditional sysvinit-utils kmod
COPY ./pkg/blobfuse-proxy/init.sh /blobfuse-proxy/
COPY ./pkg/blobfuse-proxy/install-proxy.sh /blobfuse-proxy/
COPY ./pkg/blobfuse-proxy/install-proxy-rhcos.sh /blobfuse-proxy/
COPY ./pkg/blobfuse-proxy/blobfuse-proxy.service /blobfuse-proxy/
COPY ./_output/${ARCH}/blobfuse-proxy /blobfuse-proxy/
RUN chmod +x /blobfuse-proxy/init.sh && \
chmod +x /blobfuse-proxy/install-proxy-rhcos.sh && \
chmod +x /blobfuse-proxy/install-proxy.sh && \
chmod +x /blobfuse-proxy/blobfuse-proxy.service && \
chmod +x /blobfuse-proxy/blobfuse-proxy
RUN if [ "$ARCH" = "amd64" ] ; then \
clean-install libcurl4-gnutls-dev \
&& dpkg -i /blobfuse-proxy/packages-microsoft-prod-18.04.deb \
&& apt update \
&& apt install -y blobfuse blobfuse2 fuse; fi
RUN if [ "$ARCH" = "arm64" ] ; then \
dpkg -i /blobfuse-proxy/packages-microsoft-prod-22.04.deb \
&& apt update \
&& apt install -y fuse3 blobfuse2; fi
LABEL maintainers="andyzhangx"
LABEL description="Azure Blob Storage CSI driver"
ENTRYPOINT ["/blobplugin"]