Skip to content

Commit

Permalink
Update xgo dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jchv committed Jun 22, 2024
1 parent 8b0a787 commit bd83ed0
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions ci/xgo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# Modified to use crazymax/xgo as the base image.
# --
# Copyright (c) 2017-2020 Bill Zissimopoulos
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand All @@ -23,33 +23,41 @@
# --
# https://github.com/billziss-gh/cgofuse/

FROM crazymax/xgo:1.16.6
FROM docker.io/alpine:3.20.1

# Install latest 7-zip for newer DMG/HFS support.
RUN wget https://www.7-zip.org/a/7z2102-linux-x64.tar.xz && \
tar xvf 7z2102-linux-x64.tar.xz -C /usr/bin/
RUN apk add --no-cache curl 7zip

ARG macfuse_version=4.1.2
ARG winfsp_version=1.10B2
RUN wget -q -O macfuse.dmg "https://github.com/osxfuse/osxfuse/releases/download/macfuse-${macfuse_version}/macfuse-${macfuse_version}.dmg" && \
RUN curl -L -o macfuse.dmg "https://github.com/osxfuse/osxfuse/releases/download/macfuse-${macfuse_version}/macfuse-${macfuse_version}.dmg" && \
7zz e macfuse.dmg "macFUSE/Extras/macFUSE ${macfuse_version}.pkg" && \
7zz e "macFUSE ${macfuse_version}.pkg" Core.pkg/Payload && \
7zz e Payload && \
(7zz x Payload~ -o/tmp || true) && \
mkdir /usr/local/include/osxfuse && \
mkdir -p /usr/local/include/osxfuse && \
cp -R /tmp/usr/local/include/fuse /usr/local/include/osxfuse && \
ls -lah /tmp/usr/local/lib/ && \
cp /tmp/usr/local/lib/libfuse.2.dylib /usr/local/lib/libosxfuse.dylib

ARG winfsp_version=2.0
RUN curl -L -o winfsp.zip "https://github.com/winfsp/winfsp/archive/v${winfsp_version}.zip" && \
7zz e winfsp.zip "winfsp-${winfsp_version}/inc/fuse/*" -o/usr/local/include/winfsp

RUN apk add --no-cache 7zip

FROM docker.io/crazymax/xgo:1.22.1

RUN dpkg --add-architecture i386 && \
dpkg --add-architecture amd64 && \
apt-get update && \
apt-get install -y --no-install-recommends libfuse-dev:i386 && \
apt-get install -y --no-install-recommends libfuse-dev:amd64 && \
apt-get download libfuse-dev:i386 && \
dpkg -x libfuse-dev*i386*.deb /
dpkg -x libfuse-dev*i386*.deb / && \
mkdir -p /usr/local/include && \
mkdir -p /usr/local/lib

RUN wget -q -O winfsp.zip "https://github.com/billziss-gh/winfsp/archive/v${winfsp_version}.zip" && \
7zz e winfsp.zip "winfsp-${winfsp_version}/inc/fuse/*" -o/usr/local/include/winfsp
COPY --from=0 /usr/local/include/osxfuse /usr/local/include/osxfuse
COPY --from=0 /usr/local/lib/libosxfuse.dylib /usr/local/lib/libosxfuse.dylib
COPY --from=0 /usr/local/include/winfsp /usr/local/include/winfsp

ENV OSXCROSS_NO_INCLUDE_PATH_WARNINGS 1
ENV OSXCROSS_NO_INCLUDE_PATH_WARNINGS 1

0 comments on commit bd83ed0

Please sign in to comment.