anyproto / any-sync-dockercompose

docker-compose for testing any-sync
MIT License
238 stars 30 forks source link

no buildkit #28

Closed zcr268 closed 3 months ago

zcr268 commented 3 months ago

Have you read a contributing guide?

Current Behavior

docker build -t generateconfig -f Dockerfile-generateconfig .

Expected Behavior

build sucess

Steps To Reproduce

docker build -t generateconfig -f Dockerfile-generateconfig .

Environment

- OS:DSM 7.2
- Version:

Anything else?

Step 6/15 : COPY --chmod=777 docker-generateconfig/generate_config.sh .env . the --chmod option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled root@d68455700cec:/ql/data/scripts/any-sync-dockercompose $ DOCKER_BUILDKIT=1 docker build -t generateconfig -f Dockerfile-generateconfig . ERROR: BuildKit is enabled but the buildx component is missing or broken.


FROM golang:1.21.6-alpine3.19 as generator
RUN apk add --no-cache bash yq
RUN go install github.com/anyproto/any-sync-tools/anyconf@latest
WORKDIR /opt/generateconfig
COPY ./storage/docker-generateconfig/ .
COPY docker-generateconfig/generate_config.sh .
COPY .env .
RUN chmod +x generate_config.sh
RUN ./generate_config.sh

FROM alpine:3.18.4
RUN apk add --no-cache bash yq perl python3 py3-yaml rsync
WORKDIR /opt/processing
COPY docker-generateconfig/etc/ tmp-etc/
COPY docker-generateconfig/processing.sh .
COPY docker-generateconfig/setListenIp.py .
RUN chmod +x processing.sh setListenIp.py
COPY --from=generator /opt/generateconfig/ generateconfig/

CMD ./processing.sh
mighty-sponge commented 3 months ago

Hey!

  1. Try enabling support in the Docker daemon settings in /etc/docker/daemon.json:

      {
        "features": {
          "buildkit": true
        }
      }

    Then restart the daemon systemctl restart docker.

  2. You can build the generateconfig image on any machine using newer versions of Docker that has BuildKit built in. Then save the image docker image save generateconfig > generateconfig.tar, and finally import it on the target machine using docker import.