-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: docker dev image on each main branch commit (#224)
Signed-off-by: Kush Sharma <[email protected]>
- Loading branch information
1 parent
5f9096d
commit dea4e8a
Showing
4 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
dev: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20" | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: docker.io | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Publish dev image | ||
id: docker_dev_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
file: "./Dockerfile.dev" | ||
tags: raystack/compass:dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM golang:1.20-alpine3.17 as builder | ||
RUN apk add make | ||
WORKDIR /build/ | ||
COPY . . | ||
RUN make build | ||
|
||
FROM alpine:3.17 | ||
|
||
COPY --from=builder /build/compass /usr/bin/compass | ||
RUN apk update | ||
RUN apk add ca-certificates | ||
|
||
# glibc compatibility library, since go binaries | ||
# don't work well with musl libc that alpine uses | ||
RUN apk add libc6-compat | ||
|
||
ENTRYPOINT ["compass"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters