|
|
|
FROM golang:alpine AS builder |
|
|
|
|
|
RUN apk update && apk add --no-cache \ |
|
curl \ |
|
p7zip |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
RUN --mount=type=secret,id=ZIP_PASSWD,mode=0444,required=true \ |
|
version=$(basename $(curl -sL -o /dev/null -w %{url_effective} https://github.com/wozulong/fuclaude/releases/latest)) \ |
|
&& base_url="https://github.com/wozulong/fuclaude/releases/expanded_assets/$version" \ |
|
&& latest_url=https://github.com/$(curl -sL $base_url | grep -o 'href="[^"]*linux-amd64[^"]*\.zip"' | sed 's/.*href="//' | sed 's/".*//') \ |
|
&& curl -Lo fuclaude.zip $latest_url \ |
|
&& 7z e -p$(cat /run/secrets/ZIP_PASSWD) fuclaude.zip \ |
|
&& rm fuclaude.zip \ |
|
&& chmod 777 -R . |
|
|
|
|
|
|
|
RUN --mount=type=secret,id=CONFIG_JSON,mode=0444,required=true \ |
|
cat /run/secrets/CONFIG_JSON > config.json && chmod 777 config.json |
|
|
|
|
|
RUN chmod 777 ./fuclaude |
|
|
|
|
|
RUN mkdir /.cache && chmod 777 /.cache |
|
|
|
|
|
CMD ["./fuclaude"] |
|
|