File tree Expand file tree Collapse file tree 6 files changed +46
-1
lines changed Expand file tree Collapse file tree 6 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ SHELLHUB_ENTERPRISE_ADMIN_PASSWORD=
5151# Internal to our cloud service. - don't worry about it
5252SHELLHUB_CLOUD = false
5353
54+ # Set Go modules proxy cache URL (development only)
55+ # SHELLHUB_GOPROXY=http://localhost:3333
56+
57+ # Set NPM proxy cache URL (development only)
58+ # SHELLHUB_NPM_REGISTRY=http://localhost:4873
59+
5460# Webhook config
5561SHELLHUB_WEBHOOK_URL = " "
5662SHELLHUB_WEBHOOK_PORT = " "
Original file line number Diff line number Diff line change 11# base stage
22FROM golang:1.16.4-alpine3.13 AS base
33
4+ ARG GOPROXY
5+
46RUN apk add --update git ca-certificates build-base bash util-linux setpriv
57
68RUN ln -sf /bin/bash /bin/sh
@@ -19,6 +21,7 @@ RUN go mod download
1921FROM base AS builder
2022
2123ARG SHELLHUB_VERSION=latest
24+ ARG GOPROXY
2225
2326COPY ./pkg $GOPATH/src/github.com/shellhub-io/shellhub/pkg
2427COPY ./agent .
@@ -34,6 +37,9 @@ RUN go build -tags docker -ldflags "-X main.AgentVersion=${SHELLHUB_VERSION}"
3437# development stage
3538FROM base AS development
3639
40+ ARG GOPROXY
41+ ENV GOPROXY ${GOPROXY}
42+
3743RUN apk add --update openssl openssh-client
3844RUN go get github.com/markbates/refresh && go get github.com/golangci/golangci-lint/cmd/
[email protected] 3945
Original file line number Diff line number Diff line change 11# base stage
22FROM golang:1.16.4-alpine3.13 AS base
33
4+ ARG GOPROXY
5+
46RUN apk add --no-cache git ca-certificates
57
68WORKDIR $GOPATH/src/github.com/shellhub-io/shellhub
@@ -16,6 +18,8 @@ RUN go mod download
1618# builder stage
1719FROM base AS builder
1820
21+ ARG GOPROXY
22+
1923COPY ./pkg $GOPATH/src/github.com/shellhub-io/shellhub/pkg
2024COPY ./api .
2125
@@ -30,6 +34,9 @@ RUN go build
3034# development stage
3135FROM base AS development
3236
37+ ARG GOPROXY
38+ ENV GOPROXY ${GOPROXY}
39+
3340RUN apk add --update openssl build-base docker-cli
3441RUN go get github.com/markbates/refresh && \
3542 go get github.com/golangci/golangci-lint/cmd/
[email protected] && \
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ services:
77 context : .
88 dockerfile : ssh/Dockerfile
99 target : development
10+ network : host
11+ args :
12+ - GOPROXY=${SHELLHUB_GOPROXY}
1013 volumes :
1114 - ./ssh:/go/src/github.com/shellhub-io/shellhub/ssh
1215 - ./pkg:/go/src/github.com/shellhub-io/shellhub/pkg
@@ -18,6 +21,9 @@ services:
1821 context : .
1922 dockerfile : api/Dockerfile
2023 target : development
24+ network : host
25+ args :
26+ - GOPROXY=${SHELLHUB_GOPROXY}
2127 volumes :
2228 - ./api:/go/src/github.com/shellhub-io/shellhub/api
2329 - ./pkg:/go/src/github.com/shellhub-io/shellhub/pkg
@@ -28,6 +34,9 @@ services:
2834 context : .
2935 dockerfile : ui/Dockerfile
3036 target : development
37+ network : host
38+ args :
39+ - NPM_CONFIG_REGISTRY=${SHELLHUB_NPM_REGISTRY}
3140 volumes :
3241 - ./ui:/src
3342 environment :
@@ -47,8 +56,11 @@ services:
4756 context : .
4857 dockerfile : agent/Dockerfile
4958 target : development
59+ network : host
5060 args :
51- SHELLHUB_VERSION : latest
61+ - SHELLHUB_VERSION=latest
62+ - GOPROXY=${SHELLHUB_GOPROXY}
63+
5264 privileged : true
5365 network_mode : host
5466 pid : host
Original file line number Diff line number Diff line change 11# base stage
22FROM golang:1.16.4-alpine3.13 AS base
33
4+ ARG GOPROXY
5+
46RUN apk add --update git ca-certificates build-base openssh-client
57
68WORKDIR $GOPATH/src/github.com/shellhub-io/shellhub
@@ -16,6 +18,8 @@ RUN go mod download
1618# builder stage
1719FROM base AS builder
1820
21+ ARG GOPROXY
22+
1923COPY ./pkg $GOPATH/src/github.com/shellhub-io/shellhub/pkg
2024COPY ./ssh .
2125
@@ -30,6 +34,9 @@ RUN go build -tags internal_api
3034# development stage
3135FROM base AS development
3236
37+ ARG GOPROXY
38+ ENV GOPROXY ${GOPROXY}
39+
3340RUN apk add --update openssl
3441RUN go get github.com/markbates/refresh && go get github.com/golangci/golangci-lint/cmd/
[email protected] 3542
Original file line number Diff line number Diff line change 11FROM node:12.16.0-alpine as base
22
3+ ARG NPM_CONFIG_REGISTRY
4+
35RUN apk add --update build-base python
46
57WORKDIR /app
@@ -10,6 +12,9 @@ RUN npm install
1012
1113FROM base as development
1214
15+ ARG NPM_CONFIG_REGISTRY
16+ ARG ENV ${NPM_CONFIG_REGISTRY}
17+
1318WORKDIR /src
1419
1520COPY --from=base /app/node_modules /node_modules
@@ -20,6 +25,8 @@ CMD ["/scripts/entrypoint-dev.sh"]
2025
2126FROM base as builder
2227
28+ ARG NPM_CONFIG_REGISTRY
29+
2330WORKDIR /app
2431
2532COPY ui/. .
You can’t perform that action at this time.
0 commit comments