Skip to content

Commit 450a6a6

Browse files
committed
Initial commit
Signed-off-by: Feunteun Glenn <glenn.feunteun@orange.com>
0 parents  commit 450a6a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5543
-0
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.git
2+
.gitignore
3+
Makefile
4+
README.md
5+
rks-openapi.yaml
6+
root_token
7+
scripts

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*/__pycache__
2+
*.pyc
3+
*/build
4+
*/dist
5+
*/*.egg-info
6+
**/*.swp
7+
.tox
8+
*.tar.gz
9+
**/.ycm_extra_conf.py
10+
**/global_extra_conf.py
11+
tests/rksclient
12+
root_token

Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM golang:1.13.6-alpine AS build
2+
3+
RUN apk add --no-cache git
4+
5+
WORKDIR /rks/
6+
7+
COPY go.mod ./go.mod
8+
COPY go.sum ./go.sum
9+
# Install dependencies before copying code and benefit from docker caching
10+
RUN go mod download
11+
12+
COPY . .
13+
14+
ENV CGO_ENABLED=0
15+
RUN go build -a -installsuffix cgo -o bin/rks .
16+
17+
FROM alpine:3.11.2 AS runtime
18+
LABEL name="RKS Server" \
19+
description="Remote Key Server image" \
20+
url="https://github.com/Orange-OpenSource/remote-key-server" \
21+
maintainer="glenn.feunteun@orange.com"
22+
23+
RUN addgroup -g 1000 -S rks && \
24+
adduser -u 1000 -S rks -G rks
25+
26+
USER rks
27+
28+
#HEALTHCHECK --interval=5s --timeout=2s --retries=3 \
29+
# CMD wget --no-check-certificate -q -O - https://localhost:8080/healthz || exit 1
30+
31+
COPY --from=build /rks/bin/rks /usr/bin/rks
32+
COPY certs ./certs/
33+
EXPOSE 8080/tcp
34+
ENTRYPOINT ["rks"]

Dockerfile.coverage

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM golang:1.13.6-alpine AS build
2+
3+
RUN apk add --no-cache git
4+
5+
WORKDIR /rks/
6+
7+
COPY go.mod ./go.mod
8+
COPY go.sum ./go.sum
9+
# Install dependencies before copying code and benefit from docker caching
10+
RUN go mod download
11+
12+
COPY . .
13+
COPY main.go .
14+
15+
ENV CGO_ENABLED=0
16+
17+
# !!! Instrument binary with coverage probes
18+
# !!! On exit, the binary will leave a coverage file
19+
# !!! At -test.coverprofile /path/to/coverage/file
20+
RUN go test -c -covermode=count -coverpkg ./... -o bin/rks
21+
22+
FROM alpine:3.11.2 AS runtime
23+
LABEL name="RKS Server" \
24+
description="Remote Key Server image" \
25+
url="https://github.com/Orange-OpenSource/remote-key-server" \
26+
maintainer="glenn.feunteun@orange.com"
27+
28+
RUN addgroup -g 1000 -S rks && \
29+
adduser -u 1000 -S rks -G rks
30+
31+
USER rks
32+
33+
COPY --from=build /rks/bin/rks ./rks
34+
COPY certs ./certs/
35+
EXPOSE 8080/tcp
36+
ENTRYPOINT ["./rks"]

0 commit comments

Comments
 (0)