P
P
Pavel Rogov2018-02-05 12:02:06
go
Pavel Rogov, 2018-02-05 12:02:06

How to use Go plugins in Docker?

There is a report service on go, written through plugins.
I'm trying to deploy it on docker

FROM golang:1.8.5

RUN mkdir -p /go/src/reports

WORKDIR /go/src/reports

COPY . .

RUN go-wrapper download

RUN go-wrapper install

RUN go build -buildmode=plugin -o Reports/IssuanceStats/IssuanceStats.so Reports/IssuanceStats/IssuanceStats.go
RUN go build -buildmode=plugin -o Reports/PCC/PCC.so Reports/PCC/PCC.go
RUN go build -buildmode=plugin -o Rrports/Redemption/Redemption.so Reports/Redemption/Redemption.go
 
CMD ["go-wrapper", "run", "-web"]

EXPOSE 8081

The image is built, I run docker-compose up
golang_1.0:
  restart: always
  image: golang_1.0
  net: "host"

Everything starts working, I try a request to get data from reports, it crashes with a plugin error
.
symReport, err := plug.Lookup(reportName)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Rogov, 2018-02-06
@RogovP

There was an error in the Dockerfile Fixed
- everything works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question