Need help in Dockerfile syntax error!

Hey everyone,

I’ve been working on integrating Docker into my project, but I’ve encountered a persistent error that’s been giving me quite a headache. Whenever I try to build my Docker image using a specific Dockerfile, I keep getting the following error:

Error Name: Dockerfile syntax error
Description: This error pops up when I run ‘docker build’ with my Dockerfile. Despite carefully checking the syntax and ensuring it follows Docker conventions, I can’t seem to figure out what’s causing this issue. I’ve tried various troubleshooting steps like rebuilding the Dockerfile from scratch, but the error persists.

Thanks in advance!

Hi @rohan02,

Welcome to the Stereolabs forums :wave:

Could you provide more information on the issue you are having? Can you share your Dockerfile as well as the docker build command you are using which results in these errors?

# syntax=docker/dockerfile:1
FROM golang:1.21
WORKDIR /src
COPY <<EOF ./main.go
package main

import "fmt"

func main() {
  fmt.Println("hello, world")
}
EOF
RUN go build -o /bin/hello ./main.go

FROM scratch
COPY --from=0 /bin/hello /bin/hello
CMD ["/bin/hello"]
DOCKER_BUILDKIT=0 docker build --no-cache -f Dockerfile --target stage2 .
Sending build context to Docker daemon  219.1kB
Step 1/6 : FROM ubuntu AS base
 ---> a7870fd478f4
Step 2/6 : RUN echo "base"
 ---> Running in e850d0e42eca
base
Removing intermediate container e850d0e42eca
 ---> d9f69f23cac8
Step 3/6 : FROM base AS stage1
 ---> d9f69f23cac8
Step 4/6 : RUN echo "stage1"
 ---> Running in 758ba6c1a9a3
stage1
Removing intermediate container 758ba6c1a9a3
 ---> 396baa55b8c3
Step 5/6 : FROM base AS stage2
 ---> d9f69f23cac8
Step 6/6 : RUN echo "stage2"
 ---> Running in bbc025b93175
stage2
Removing intermediate container bbc025b93175
 ---> 09fc3770a9c4
Successfully built 09fc3770a9c4

I use this during my docker training google cloud platform training

I do not see the error you are mentioning, the image seems to have been successfully built.

If you do not have any questions about the ZED SDK or Stereolabs products, I invite you to ask your questions on the Docker forums or on StackOverflow.