Skip to content

Commit

Permalink
Docker build files
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaynard committed Jul 8, 2020
1 parent 9550bd0 commit 828a369
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- uses: engineerd/setup-kind@v0.4.0
- name: Testing
run: |
Expand Down
15 changes: 15 additions & 0 deletions WatchConfigMap.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:alpine AS build-env
RUN apk --no-cache add build-base git gcc
ADD . /src
RUN cd /src && go build -o kubevol


FROM alpine
WORKDIR /app
COPY --from=build-env /src/kubevol /app/

EXPOSE 8080

RUN mkdir -p /app/mocks

CMD ["/app/kubevol", "watch-configmap"]
15 changes: 15 additions & 0 deletions WatchSecret.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:alpine AS build-env
RUN apk --no-cache add build-base git gcc
ADD . /src
RUN cd /src && go build -o kubevol


FROM alpine
WORKDIR /app
COPY --from=build-env /src/kubevol /app/

EXPOSE 8080

RUN mkdir -p /app/mocks

CMD ["/app/kubevol", "watch-secret"]
11 changes: 11 additions & 0 deletions build-publish-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

cd $DIR

docker build -f WatchSecret.Dockerfile -t bmaynard/kubevol-watch-secret:latest .
docker build -f WatchConfigMap.Dockerfile -t bmaynard/kubevol-watch-configmap:latest .

docker push bmaynard/kubevol-watch-secret:latest
docker push bmaynard/kubevol-watch-configmap:latest

0 comments on commit 828a369

Please sign in to comment.