# Problem during running docker build

**URL:** <https://discuss.elastic.co/t/problem-during-running-docker-build/251567>\
**Category:** Elastic Observability\
**Tags:** docker\
**Created:** [October 9, 2020, 1:06pm UTC](https://discuss.elastic.co/t/problem-during-running-docker-build/251567 "2020-10-09T13:06:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryce\_Fernandes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bryce_fernandes/32/71166_2.png) [@Bryce\_Fernandes](https://discuss.elastic.co/u/Bryce_Fernandes)\
**Post date:** [October 9, 2020, 1:06pm UTC](https://discuss.elastic.co/t/problem-during-running-docker-build/251567/1 "2020-10-09T13:06:40Z")

</div>

Hi,

I wanted to implement microservices application with elastic apm using docker so followed this guide.

[Guide link](https://www.elastic.co/blog/how-to-instrument-a-polyglot-microservices-application-with-elastic-apm)

I am new to docker. However i faced issue running docker-compose up --build. Please help resolve.  
OS: centos 7

Building auth-api  
Step 1/9 : FROM golang:1.9-alpine  
---\> b0260be938c6  
Step 2/9 : EXPOSE 8081  
---\> Using cache  
---\> 6776678a08f2  
Step 3/9 : WORKDIR /go/src/app  
---\> Using cache  
---\> 0d0646e1d9bc  
Step 4/9 : RUN apk --no-cache add curl git && curl [https://raw.githubusercontent.com/golang/dep/master/install.sh](https://raw.githubusercontent.com/golang/dep/master/install.sh) | sh  
---\> Using cache  
---\> 7516bdffa2f9  
Step 5/9 : COPY . .  
---\> 04d289b4ee40  
Step 6/9 : RUN dep ensure  
---\> Running in 9dd3b5794931  
Removing intermediate container 9dd3b5794931  
---\> 1a010eb88412  
Step 7/9 : RUN dep ensure -update [golang.org/x/sys](http://golang.org/x/sys)  
---\> Running in 9357ff5a3f22  
Removing intermediate container 9357ff5a3f22  
---\> c2de5ad5d991  
Step 8/9 : RUN go build -o auth-api  
---\> Running in d48ba80be329

```auto
#app/vendor/github.com/elastic/go-sysinfo/providers/aix
exec: "gcc": executable file not found in $PATH
ERROR: Service 'auth-api' failed to build: The command '/bin/sh -c go build -o auth-api' returned a non-zero code: 2

```

After some research i added alphine-sdk in Dockerfile under auth-api folder.

`RUN apk add --update alpine-sdk`

Error got resolved but getting other error now.

Step 8/11 : RUN dep ensure  
---\> Running in 9711a810ca23  
Removing intermediate container 9711a810ca23  
---\> 12c5bfc79f7e  
Step 9/11 : RUN dep ensure -update [golang.org/x/sys](http://golang.org/x/sys)  
---\> Running in 38d3e613aa31  
Removing intermediate container 38d3e613aa31  
---\> 44b55351a1c0  
Step 10/11 : RUN go build -o auth-api  
---\> Running in 493b67abeab6

```auto
#app/vendor/github.com/elastic/go-sysinfo/providers/aix
vendor/github.com/elastic/go-sysinfo/providers/aix/host_aix.go:23:25: fatal error: libperfstat.h: No such file or directory
 #include <libperfstat.h>
                         ^
compilation terminated.
ERROR: Service 'auth-api' failed to build: The command '/bin/sh -c go build -o auth-api' returned a non-zero code: 2

```

Thanks and regards,  
Bryce Fernandes.

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [October 12, 2020, 2:25am UTC](https://discuss.elastic.co/t/problem-during-running-docker-build/251567/2 "2020-10-12T02:25:58Z")

</div>

For Go 1.9 you'll need to pin elastic/go-sysinfo to v1.3.0. If you can update to a newer version of Go with support for modules, you'll probably have a better time.

---

<div class="post-metadata">

**Author:** ![Bryce\_Fernandes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bryce_fernandes/32/71166_2.png) [@Bryce\_Fernandes](https://discuss.elastic.co/u/Bryce_Fernandes)\
**Post date:** [October 12, 2020, 11:21am UTC](https://discuss.elastic.co/t/problem-during-running-docker-build/251567/3 "2020-10-12T11:21:02Z")

</div>

Hi @axw ,

Thanks for the reply, changed the version and it worked 😃 .

replaced  
`FROM golang:1.9-alpine`  
with  
`FROM golang:1.15.2-alpine`

Thanks and regards,  
Bryce Fernandes.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 8:15am UTC](https://discuss.elastic.co/t/problem-during-running-docker-build/251567/4 "2022-11-04T08:15:03Z")

</div>


