forked from tty47/torch
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #2 from celestiaorg/jose/torch-v1
feat(torch): v1 resources added
- Loading branch information
Showing
35 changed files
with
2,233 additions
and
790 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 |
---|---|---|
|
@@ -3,4 +3,4 @@ torch | |
.DS_Store | ||
.idea | ||
|
||
*otel-agent-celestia.yaml | ||
*otel-agent-*.yaml |
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,12 +1,38 @@ | ||
FROM golang:1.21.0-bullseye AS builder | ||
# stage 1 Generate torch Binary | ||
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.3-alpine3.18 as builder | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
ENV CGO_ENABLED=0 | ||
ENV GO111MODULE=on | ||
|
||
WORKDIR / | ||
|
||
COPY go.mod go.sum ./ | ||
# Download dependencies | ||
RUN go mod download | ||
COPY . . | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /go/bin/torch ./cmd/main.go | ||
RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /go/bin/torch ./cmd/main.go | ||
|
||
FROM alpine:latest | ||
# stage 2 | ||
FROM docker.io/alpine:3.18.4 | ||
WORKDIR / | ||
# Read here why UID 10001: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000 | ||
ARG UID=10001 | ||
ARG USER_NAME=torch | ||
|
||
ENV USR_HOME=/home/${USER_NAME} | ||
|
||
# hadolint ignore=DL3018 | ||
RUN adduser ${USER_NAME} \ | ||
-D \ | ||
-g ${USER_NAME} \ | ||
-h ${USR_HOME} \ | ||
-s /sbin/nologin \ | ||
-u ${UID} | ||
|
||
COPY --from=builder /go/bin/torch . | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["./torch"] |
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,11 +1,37 @@ | ||
FROM golang:1.21.0-bullseye AS builder | ||
# stage 1 Generate torch Binary | ||
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.3-alpine3.18 as builder | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
ENV CGO_ENABLED=0 | ||
ENV GO111MODULE=on | ||
|
||
WORKDIR / | ||
|
||
COPY go.mod go.sum ./ | ||
# Download dependencies | ||
RUN go mod download | ||
COPY torch /go/bin/torch | ||
|
||
FROM alpine:latest | ||
# stage 2 | ||
FROM docker.io/alpine:3.18.4 | ||
WORKDIR / | ||
# Read here why UID 10001: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000 | ||
ARG UID=10001 | ||
ARG USER_NAME=torch | ||
|
||
ENV USR_HOME=/home/${USER_NAME} | ||
|
||
# hadolint ignore=DL3018 | ||
RUN adduser ${USER_NAME} \ | ||
-D \ | ||
-g ${USER_NAME} \ | ||
-h ${USR_HOME} \ | ||
-s /sbin/nologin \ | ||
-u ${UID} | ||
|
||
COPY --from=builder /go/bin/torch . | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["./torch"] |
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
Oops, something went wrong.