Skip to content
Snippets Groups Projects
Commit 0640d3f0 authored by Manuel Heß's avatar Manuel Heß
Browse files

new version with cloning plugin

parent 237e008d
No related branches found
No related tags found
No related merge requests found
FROM golang AS pluginBuild FROM golang AS pluginBuild
ARG pluginname ARG pluginRepoUrl
WORKDIR /app WORKDIR /app
COPY core/. ../core/ RUN git clone $pluginRepoUrl .
COPY $pluginname/go.mod $pluginname/go.sum ./
RUN go mod download RUN go mod download
COPY $pluginname/. ./ RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -buildmode=plugin -o /plugin
RUN CGO_ENABLED=1 GOOS=linux go build -buildmode=plugin -o /plugin
FROM golang AS coreBuild FROM golang AS coreBuild
ARG servicename
WORKDIR /app WORKDIR /app
COPY core/. ../core/ COPY go.mod go.sum ./
COPY $servicename/go.mod $servicename/go.sum ./
RUN go mod download RUN go mod download
COPY $servicename/. ./ COPY . ./
RUN CGO_ENABLED=1 GOOS=linux go build -o /$servicename RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o /microservice
FROM golang FROM golang
ARG servicename
ARG serviceport
COPY --from=pluginBuild /plugin /app/ COPY --from=pluginBuild /plugin /etc/plugins
COPY --from=coreBuild /$servicename /app/ COPY --from=coreBuild /microservice /
EXPOSE $serviceport EXPOSE 3000
ENTRYPOINT [ "/app/$servicename" ] CMD ["../microservice"]
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment