Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Go Plugin Docker Template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Manuel Heß
Go Plugin Docker Template
Commits
0640d3f0
Commit
0640d3f0
authored
1 year ago
by
Manuel Heß
Browse files
Options
Downloads
Patches
Plain Diff
new version with cloning plugin
parent
237e008d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+10
-17
10 additions, 17 deletions
Dockerfile
with
10 additions
and
17 deletions
Dockerfile
+
10
−
17
View file @
0640d3f0
FROM
golang
AS
pluginBuild
FROM
golang
AS
pluginBuild
ARG
plugin
name
ARG
plugin
RepoUrl
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
/
$
service
name
RUN
CGO_ENABLED
=
1
GOOS
=
linux
GOARCH
=
amd64
go build
-o
/
micro
service
FROM
golang
FROM
golang
ARG
servicename
ARG
serviceport
COPY
--from=pluginBuild /plugin /
app/
COPY
--from=pluginBuild /plugin /
etc/plugins
COPY
--from=coreBuild /
$
service
name /app
/
COPY
--from=coreBuild /
micro
service
/
EXPOSE
$serviceport
EXPOSE
3000
ENTRYPOINT
[ "/app/$servicename" ]
CMD
["../microservice"]
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment