Skip to content

Commit

Permalink
fix run
Browse files Browse the repository at this point in the history
  • Loading branch information
fyInALT committed May 12, 2024
1 parent 4a39168 commit 4b80d57
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 16 deletions.
14 changes: 10 additions & 4 deletions ops/aggregator.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,27 @@ COPY go.mod go.sum ./

ENV GOPRIVATE=github.com/alt-research/avs-generic-aggregator
ARG XDG_CONFIG_HOME=/root/.config/

RUN \
--mount=type=secret,id=gh_hosts,target=/root/.config/gh/hosts.yml \
--mount=type=secret,id=git_config,target=/root/.gitconfig \
--mount=type=secret,id=git_credentials,target=/root/.git-credentials \
<<EOF
set -ex
go version
go mod download && go mod tidy && go mod verify
EOF

RUN go mod download && go mod tidy && go mod verify

COPY . .

WORKDIR /usr/src/app/aggregator/cmd
RUN go build -v -o /usr/local/bin/aggregator ./...
RUN \
--mount=type=secret,id=gh_hosts,target=/root/.config/gh/hosts.yml \
--mount=type=secret,id=git_config,target=/root/.gitconfig \
--mount=type=secret,id=git_credentials,target=/root/.git-credentials \
<<EOF
set -ex
go build -v -o /usr/local/bin/aggregator ./...
EOF

FROM debian:bullseye as app
COPY --from=build /usr/local/bin/aggregator /usr/local/bin/aggregator
Expand Down
14 changes: 10 additions & 4 deletions ops/operator-tool.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,26 @@ COPY go.mod go.sum ./

ENV GOPRIVATE=github.com/alt-research/avs-generic-aggregator
ARG XDG_CONFIG_HOME=/root/.config/

RUN \
--mount=type=secret,id=gh_hosts,target=/root/.config/gh/hosts.yml \
--mount=type=secret,id=git_config,target=/root/.gitconfig \
--mount=type=secret,id=git_credentials,target=/root/.git-credentials \
<<EOF
set -ex
go version
go mod download && go mod tidy && go mod verify
EOF

RUN go mod download && go mod tidy && go mod verify

COPY . .

RUN make build-cli
RUN \
--mount=type=secret,id=gh_hosts,target=/root/.config/gh/hosts.yml \
--mount=type=secret,id=git_config,target=/root/.gitconfig \
--mount=type=secret,id=git_credentials,target=/root/.git-credentials \
<<EOF
set -ex
make build-cli
EOF

RUN cp ./bin/mach-operator-cli /usr/local/bin/mach-operator-cli

Expand Down
14 changes: 10 additions & 4 deletions ops/operator.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,27 @@ COPY go.mod go.sum ./

ENV GOPRIVATE=github.com/alt-research/avs-generic-aggregator
ARG XDG_CONFIG_HOME=/root/.config/

RUN \
--mount=type=secret,id=gh_hosts,target=/root/.config/gh/hosts.yml \
--mount=type=secret,id=git_config,target=/root/.gitconfig \
--mount=type=secret,id=git_credentials,target=/root/.git-credentials \
<<EOF
set -ex
go version
go mod download && go mod tidy && go mod verify
EOF

RUN go mod download && go mod tidy && go mod verify

COPY . .

WORKDIR /usr/src/app/operator/cmd
RUN go build -v -o /usr/local/bin/operator ./...
RUN \
--mount=type=secret,id=gh_hosts,target=/root/.config/gh/hosts.yml \
--mount=type=secret,id=git_config,target=/root/.gitconfig \
--mount=type=secret,id=git_credentials,target=/root/.git-credentials \
<<EOF
set -ex
go build -v -o /usr/local/bin/operator ./...
EOF

FROM debian:bullseye as app
COPY --from=build /usr/local/bin/operator /usr/local/bin/operator
Expand Down
15 changes: 11 additions & 4 deletions ops/proxy.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,28 @@ COPY go.mod go.sum ./

ENV GOPRIVATE=github.com/alt-research/avs-generic-aggregator
ARG XDG_CONFIG_HOME=/root/.config/

RUN \
--mount=type=secret,id=gh_hosts,target=/root/.config/gh/hosts.yml \
--mount=type=secret,id=git_config,target=/root/.gitconfig \
--mount=type=secret,id=git_credentials,target=/root/.git-credentials \
<<EOF
set -ex
go version
go mod download && go mod tidy && go mod verify
EOF

RUN go mod download && go mod tidy && go mod verify

COPY . .

WORKDIR /usr/src/app/generic-operator-proxy/cmd
RUN go build -v -o /usr/local/bin/generic-operator-proxy ./...

RUN \
--mount=type=secret,id=gh_hosts,target=/root/.config/gh/hosts.yml \
--mount=type=secret,id=git_config,target=/root/.gitconfig \
--mount=type=secret,id=git_credentials,target=/root/.git-credentials \
<<EOF
set -ex
go build -v -o /usr/local/bin/generic-operator-proxy ./...
EOF

FROM debian:bullseye as app
COPY --from=build /usr/local/bin/generic-operator-proxy /usr/local/bin/mach-operator-proxy
Expand Down

0 comments on commit 4b80d57

Please sign in to comment.