-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Totodore/golang
Rewriting all docker ci in go for better optimization
- Loading branch information
Showing
28 changed files
with
1,392 additions
and
850 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,10 @@ | ||
.env | ||
.gitignore | ||
*.exe | ||
test/** | ||
bin/ | ||
docker/** | ||
dist/ | ||
.vscode/** | ||
data/** | ||
.github/ |
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 |
---|---|---|
|
@@ -110,4 +110,5 @@ bin/ | |
dist/ | ||
.vscode/** | ||
data/** | ||
mail.json | ||
mail.json | ||
*.exe |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,13 +1,26 @@ | ||
FROM node:14.2-alpine | ||
FROM golang:1.17.2 as builder | ||
# Define build env | ||
ENV GOOS linux | ||
ENV CGO_ENABLED 0 | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN npm install | ||
RUN go build -o app ./src | ||
|
||
FROM alpine:latest | ||
|
||
ENV PORT 8080 | ||
|
||
RUN apk add --no-cache ca-certificates | ||
|
||
RUN npm install -g typescript | ||
COPY --from=builder app . | ||
|
||
RUN npm run build | ||
EXPOSE 8080 | ||
|
||
CMD npm start | ||
CMD ./app |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module docker-ci | ||
|
||
go 1.17 | ||
|
||
require ( | ||
github.com/Microsoft/go-winio v0.4.17 // indirect | ||
github.com/containerd/containerd v1.5.7 // indirect | ||
github.com/docker/distribution v2.7.1+incompatible // indirect | ||
github.com/docker/docker v20.10.10+incompatible // indirect | ||
github.com/docker/go-connections v0.4.0 // indirect | ||
github.com/docker/go-units v0.4.0 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/golang/protobuf v1.5.0 // indirect | ||
github.com/joho/godotenv v1.4.0 // indirect | ||
github.com/julienschmidt/httprouter v1.3.0 // indirect | ||
github.com/opencontainers/go-digest v1.0.0 // indirect | ||
github.com/opencontainers/image-spec v1.0.1 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/sirupsen/logrus v1.8.1 // indirect | ||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect | ||
golang.org/x/sys v0.0.0-20210426230700-d19ff857e887 // indirect | ||
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a // indirect | ||
google.golang.org/grpc v1.41.0 // indirect | ||
google.golang.org/protobuf v1.26.0 // indirect | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,48 @@ | ||
package main | ||
|
||
type ContainerEvent string | ||
type ImageEvent string | ||
|
||
const ( | ||
attach_container ContainerEvent = "attach" | ||
commit_container ContainerEvent = "commit" | ||
copy_container ContainerEvent = "copy" | ||
create_container ContainerEvent = "create" | ||
destroy_container ContainerEvent = "destroy" | ||
detach_container ContainerEvent = "detach" | ||
die_container ContainerEvent = "die" | ||
exec_create_container ContainerEvent = "exec_create" | ||
exec_detach_container ContainerEvent = "exec_detach" | ||
exec_die_container ContainerEvent = "exec_die" | ||
exec_start_container ContainerEvent = "exec_start" | ||
export_container ContainerEvent = "export" | ||
health_status_container ContainerEvent = "health_status" | ||
kill_container ContainerEvent = "kill" | ||
oom_container ContainerEvent = "oom" | ||
pause_container ContainerEvent = "pause" | ||
rename_container ContainerEvent = "rename" | ||
resize_container ContainerEvent = "resize" | ||
restart_container ContainerEvent = "restart" | ||
start_container ContainerEvent = "start" | ||
stop_container ContainerEvent = "stop" | ||
top_container ContainerEvent = "top" | ||
unpause_container ContainerEvent = "unpause" | ||
update_container ContainerEvent = "update" | ||
) | ||
|
||
// const ( | ||
// delete_image ImageEvent = "delete" | ||
// import_image ImageEvent = "import" | ||
// load_image ImageEvent = "load" | ||
// pull_image ImageEvent = "pull" | ||
// push_image ImageEvent = "push" | ||
// save_image ImageEvent = "save" | ||
// tag_image ImageEvent = "tag" | ||
// untag_image ImageEvent = "untag" | ||
// ) | ||
|
||
type DockerAuth struct { | ||
Username string `json:"username,omitempty"` | ||
Password string `json:"password,omitempty"` | ||
Serveraddress string `json:"serveraddress,omitempty"` | ||
} |
Oops, something went wrong.