UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Platform One
P
Party Bus
Valkyrie
valkyrie-api
Commits
c316b5c8
Commit
c316b5c8
authored
Jul 02, 2021
by
Jason van Brackel
Browse files
Merge remote-tracking branch 'origin/master' into dev-jvb-629
parents
111f45c6
cc1a60c6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
20 deletions
+65
-20
.dockerignore
.dockerignore
+5
-3
.gitignore
.gitignore
+2
-1
Dockerfile
Dockerfile
+10
-15
Dockerfile.local
Dockerfile.local
+35
-0
README.md
README.md
+13
-1
No files found.
.dockerignore
View file @
c316b5c8
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
# Ignore all files which are not go type
!**/*.go
!**/*.mod
!**/*.sum
# !**/*.go
# !**/*.mod
# !**/*.sum
testbin
\ No newline at end of file
.gitignore
View file @
c316b5c8
...
...
@@ -26,4 +26,5 @@ coverage.html
*.swo
*~
.vscode
\ No newline at end of file
.vscode
.gomodcache
Dockerfile
View file @
c316b5c8
# NOTE: USING THIS IMAGE UNTIL registry1 credentials are added to IL2 runners
# Build the manager binary
FROM
registry.il2.dso.mil/platform-one/devops/pipeline-templates/valkyrie/golang-builder-1.6:1.0 as builder
FROM
registry.il2.dso.mil/platform-one/devops/pipeline-templates/valkyrie/golang-builder-1.16:1.1 as builder
# note: Adam tried to use GOMODCACHE env variable to pull in go cache
# it worked locally but not with buildah.
WORKDIR
/workspace
# Copy the Go Modules manifests
COPY
go.mod go.mod
COPY
go.sum go.sum
USER
root
RUN
chmod
755 go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN
go mod download
# Copy the go source
COPY
main.go main.go
COPY
driver.go driver.go
COPY
go.mod go.sum ./
COPY
main.go main.go driver.go driver.go ./
COPY
apis/ apis/
COPY
config/ config/
COPY
custom/ custom/
COPY
controllers/ controllers/
COPY
clients/ clients/
# RUN chmod 755 go.sum
# download with json logging
# RUN go mod download -json
RUN
go mod download
# Build
RUN
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
amd64
GO111MODULE
=
on go build
-a
-o
manager main.go driver.go
# make hadolint happy. set user to non root user
USER
golanguser
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
...
...
Dockerfile.local
0 → 100644
View file @
c316b5c8
# NOTE: USING THIS IMAGE UNTIL registry1 credentials are added to IL2 runners
# Build the manager binary
FROM registry.il2.dso.mil/platform-one/devops/pipeline-templates/valkyrie/golang-builder-1.6:1.0 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
USER root
RUN chmod 755 go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY main.go main.go
COPY driver.go driver.go
COPY apis/ apis/
COPY config/ config/
COPY controllers/ controllers/
COPY clients/ clients/
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go driver.go
# make hadolint happy. set user to non root user
USER golanguser
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM registry.il2.dso.mil/platform-one/devops/pipeline-templates/base-image/harden-ubi8-8.4:1.0
WORKDIR /app
COPY --from=builder /workspace/manager .
USER appuser
ENTRYPOINT ["/app/manager"]
README.md
View file @
c316b5c8
## <img src="valkyrie.png" width="60"> Valkyrie Automated CICD Provisioning Tool
## Bump
## Env Variables
-
for local building and to closer simulate the pipeline set
-
from root folder of project
-
Note: GOMODCACHE seems to be only supported in go 1.16 +
-
export GOMODCACHE=$(pwd)/.gomodcache
-
example:
```
export GOMODCACHE=.gomodcache
go mod download -json
find .gomodcache | wc -l
docker build --progress plain -t abr .
```
### Golang Frameworks
-
kubebuilder
-
https://book.kubebuilder.io/introduction.html
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment