Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
goSDN
Commits
cfb902d4
Commit
cfb902d4
authored
4 years ago
by
Manuel Kieweg
Browse files
Options
Downloads
Patches
Plain Diff
add race as build arg
parent
876456d2
No related branches found
No related tags found
1 merge request
!90
Develop
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+2
-2
2 additions, 2 deletions
Dockerfile
build/ci/.build-container.yml
+2
-0
2 additions, 0 deletions
build/ci/.build-container.yml
build/dockerfiles/staging/Dockerfile
+0
-18
0 additions, 18 deletions
build/dockerfiles/staging/Dockerfile
with
4 additions
and
20 deletions
build/dockerfiles/production/
Dockerfile
→
Dockerfile
+
2
−
2
View file @
cfb902d4
FROM
golang:1.15-alpine
AS
builder
FROM
golang:1.15-alpine
AS
builder
ARG
GITLAB_USER
ARG
GITLAB_USER
ARG
GITLAB_TOKEN
ARG
GITLAB_TOKEN
ARG
BUILDARGS
WORKDIR
/src/gosdn
WORKDIR
/src/gosdn
COPY
. .
COPY
. .
RUN
apk add git
RUN
apk add git
RUN
git config
--global
url.
"https://
$GITLAB_USER
:
$GITLAB_TOKEN
@code.fbi.h-da.de"
.insteadOf
"https://code.fbi.h-da.de"
RUN
git config
--global
url.
"https://
$GITLAB_USER
:
$GITLAB_TOKEN
@code.fbi.h-da.de"
.insteadOf
"https://code.fbi.h-da.de"
RUN
go mod download
RUN
CGO_ENABLED
=
0
GOOS
=
linux go build
$BUILDARGS
./cmd/gosdn
RUN
CGO_ENABLED
=
0
GOOS
=
linux go build ./cmd/gosdn
FROM
alpine:latest
FROM
alpine:latest
EXPOSE
8080
EXPOSE
8080
...
...
This diff is collapsed.
Click to expand it.
build/ci/.build-container.yml
+
2
−
0
View file @
cfb902d4
...
@@ -26,6 +26,7 @@ variables:
...
@@ -26,6 +26,7 @@ variables:
build:develop
:
build:develop
:
variables
:
variables
:
TAG
:
$CI_REGISTRY_IMAGE:develop
TAG
:
$CI_REGISTRY_IMAGE:develop
BUILDARGS
:
-race
DOCKERFILE
:
build/dockerfiles/staging
DOCKERFILE
:
build/dockerfiles/staging
rules
:
rules
:
-
if
:
$CI_COMMIT_BRANCH == "develop"
-
if
:
$CI_COMMIT_BRANCH == "develop"
...
@@ -34,6 +35,7 @@ build:develop:
...
@@ -34,6 +35,7 @@ build:develop:
build:merge-request
:
build:merge-request
:
variables
:
variables
:
TAG
:
$CI_REGISTRY_IMAGE:merge-request
TAG
:
$CI_REGISTRY_IMAGE:merge-request
BUILDARGS
:
-race
DOCKERFILE
:
build/dockerfiles/staging
DOCKERFILE
:
build/dockerfiles/staging
rules
:
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
...
...
This diff is collapsed.
Click to expand it.
build/dockerfiles/staging/Dockerfile
deleted
100644 → 0
+
0
−
18
View file @
876456d2
FROM
golang:1.15-alpine
AS
builder
ARG
GITLAB_USER
ARG
GITLAB_TOKEN
WORKDIR
/src/gosdn
COPY
. .
RUN
apk add git
RUN
git config
--global
url.
"https://
$GITLAB_USER
:
$GITLAB_TOKEN
@code.fbi.h-da.de"
.insteadOf
"https://code.fbi.h-da.de"
RUN
go mod download
RUN
CGO_ENABLED
=
0
GOOS
=
linux go build
-race
./cmd/gosdn
FROM
alpine:latest
EXPOSE
8080
EXPOSE
55055
COPY
--from=builder /src/gosdn/gosdn .
COPY
--from=builder /src/gosdn/configs ./configs
ENTRYPOINT
[ "./gosdn" ]
CMD
[""]
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