# Need help in Dockerfile syntax error!

**URL:** <https://community.stereolabs.com/t/need-help-in-dockerfile-syntax-error/4593>\
**Category:** Docker\
**Created:** [February 19, 2024, 7:42am UTC](https://community.stereolabs.com/t/need-help-in-dockerfile-syntax-error/4593 "2024-02-19T07:42:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohan02](https://community.stereolabs.com/user_avatar/community.stereolabs.com/rohan02/32/2578_2.png) [@rohan02](https://community.stereolabs.com/u/rohan02)\
**Post date:** [February 19, 2024, 7:42am UTC](https://community.stereolabs.com/t/need-help-in-dockerfile-syntax-error/4593/1 "2024-02-19T07:42:52Z")

</div>

Hey everyone,

I’ve been working on integrating [Docker](https://www.docker.com/) 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!

---

<div class="post-metadata">

**Author:** ![mattrouss](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mattrouss/32/2452_2.png) [@mattrouss](https://community.stereolabs.com/u/mattrouss)\
**Post date:** [February 19, 2024, 9:19am UTC](https://community.stereolabs.com/t/need-help-in-dockerfile-syntax-error/4593/2 "2024-02-19T09:19:13Z")

</div>

Hi @rohan02,

Welcome to the Stereolabs forums 👋

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?

---

<div class="post-metadata">

**Author:** ![rohan02](https://community.stereolabs.com/user_avatar/community.stereolabs.com/rohan02/32/2578_2.png) [@rohan02](https://community.stereolabs.com/u/rohan02)\
**Post date:** [February 20, 2024, 12:21pm UTC](https://community.stereolabs.com/t/need-help-in-dockerfile-syntax-error/4593/3 "2024-02-20T12:21:47Z")

</div>

```auto
# 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"]

```

```auto
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](https://www.docker.com/) [google cloud platform training](https://www.igmguru.com/cloud-computing/google-cloud-certification-training/)

---

<div class="post-metadata">

**Author:** ![mattrouss](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mattrouss/32/2452_2.png) [@mattrouss](https://community.stereolabs.com/u/mattrouss)\
**Post date:** [February 20, 2024, 12:30pm UTC](https://community.stereolabs.com/t/need-help-in-dockerfile-syntax-error/4593/4 "2024-02-20T12:30:51Z")

</div>

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](https://forums.docker.com/) or on [StackOverflow](https://stackoverflow.com/).
