actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.91k stars 965 forks source link

Error: buildx failed with: ERROR: failed to solve: dockerfile parse error on line 1: FROM requires either one or three arguments #3335

Open rhwuHub opened 5 months ago

rhwuHub commented 5 months ago

Run docker/build-push-action@v5 GitHub Actions runtime token ACs Docker info Proxy configuration Buildx version Builder info /usr/bin/docker buildx build --file ./Dockerfile --iidfile /home/runner/work/_temp/docker-actions-toolkit-FAlZHW/build-iidfile-5f972d5c25.txt --attest type=provenance,mode=max,builder-id=https://github.com/rhwuHub/action/actions/runs/9496964342 --tag registry.cn-hangzhou.aliyuncs.com/rhwu/hub:blog --metadata-file /home/runner/work/_temp/docker-actions-toolkit-FAlZHW/build-metadata-427ba9f59a.json --push .

0 building with "builder-de9ce500-2f91-41c4-9b4b-4ed33cd97df4" instance using docker-container driver

1 [internal] load build definition from dockerfile

1 transferring dockerfile: 451B done

1 DONE 0.0s

dockerfile:1

1 | >>> FROM registry.cn-hangzhou.aliyuncs.com/rhwu/hub:jdk-8 AS builder

WORKDIR /tmp

COPY . /tmp

RUN mvn package -Dmaven.test.skip=true -s /tmp/settings.xml

FROM registry.cn-hangzhou.aliyuncs.com/rhwu/hub:maven-jkd-8 as runner

WORKDIR /app

COPY --from=builder /tmp/Blog-server/target/blog.jar ./blog.jar

CMD ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005", "-jar", "/app/blog.jar"]

ERROR: failed to solve: dockerfile parse error on line 1: FROM requires either one or three arguments Error: buildx failed with: ERROR: failed to solve: dockerfile parse error on line 1: FROM requires either one or three arguments