Skip to content

Commit

Permalink
Merge pull request #41 from Shreyas220/test
Browse files Browse the repository at this point in the history
Reworking of App-Mesh adapter
  • Loading branch information
leecalcote committed Oct 13, 2021
2 parents b281506 + d71e4b2 commit 8909739
Show file tree
Hide file tree
Showing 25 changed files with 2,295 additions and 2,320 deletions.
48 changes: 33 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
FROM golang:1.12.8 as bd
RUN adduser --disabled-login appuser
WORKDIR /github.com/layer5io/meshery-app-mesh
ADD . .
RUN cd cmd; go build -ldflags="-w -s" -a -o /meshery-app-mesh .
RUN find . -name "*.go" -type f -delete; mv app-mesh /
FROM golang:1.16.0 as builder

FROM alpine
RUN apk --update add ca-certificates
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
COPY --from=bd /meshery-app-mesh /app/
COPY --from=bd /app-mesh /app/app-mesh
COPY --from=bd /etc/passwd /etc/passwd
USER appuser
WORKDIR /app
CMD ./meshery-app-mesh
ARG VERSION
ARG GIT_COMMITSHA
WORKDIR /build
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY main.go main.go
COPY internal/ internal/
COPY app_mesh/ app_mesh/
# Build
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags="-w -s -X main.version=$VERSION -X main.gitsha=$GIT_COMMITSHA" -a -o meshery-app-mesh main.go

FROM alpine:3.14 as jsonschema-util
RUN apk add --no-cache curl
WORKDIR /
RUN curl -LO https://github.com/layer5io/kubeopenapi-jsonschema/releases/download/v0.1.0/kubeopenapi-jsonschema
RUN chmod +x /kubeopenapi-jsonschema

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/base
WORKDIR /
ENV DISTRO="debian"
ENV GOARCH="amd64"
ENV SERVICE_ADDR="meshery-app-mesh"
ENV MESHERY_SERVER="http://meshery:9081"
COPY --from=builder /build/meshery-app-mesh .
ENTRYPOINT ["/meshery-app-mesh"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ docker:
docker-run:
(docker rm -f meshery-app-mesh) || true
docker run --name meshery-app-mesh -d \
-p 10000:10000 \
-p 10005:10005 \
-e DEBUG=true \
layer5/meshery-app-mesh

run:
DEBUG=true go run main.go
DEBUG=true go run main.go
Loading

0 comments on commit 8909739

Please sign in to comment.