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=
51
51
# Internal to our cloud service. - don't worry about it
52
52
SHELLHUB_CLOUD = false
53
53
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
+
54
60
# Webhook config
55
61
SHELLHUB_WEBHOOK_URL = " "
56
62
SHELLHUB_WEBHOOK_PORT = " "
Original file line number Diff line number Diff line change 1
1
# base stage
2
2
FROM golang:1.16.4-alpine3.13 AS base
3
3
4
+ ARG GOPROXY
5
+
4
6
RUN apk add --update git ca-certificates build-base bash util-linux setpriv
5
7
6
8
RUN ln -sf /bin/bash /bin/sh
@@ -19,6 +21,7 @@ RUN go mod download
19
21
FROM base AS builder
20
22
21
23
ARG SHELLHUB_VERSION=latest
24
+ ARG GOPROXY
22
25
23
26
COPY ./pkg $GOPATH/src/github.com/shellhub-io/shellhub/pkg
24
27
COPY ./agent .
@@ -34,6 +37,9 @@ RUN go build -tags docker -ldflags "-X main.AgentVersion=${SHELLHUB_VERSION}"
34
37
# development stage
35
38
FROM base AS development
36
39
40
+ ARG GOPROXY
41
+ ENV GOPROXY ${GOPROXY}
42
+
37
43
RUN apk add --update openssl openssh-client
38
44
RUN go get github.com/markbates/refresh && go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.37.1
39
45
Original file line number Diff line number Diff line change 1
1
# base stage
2
2
FROM golang:1.16.4-alpine3.13 AS base
3
3
4
+ ARG GOPROXY
5
+
4
6
RUN apk add --no-cache git ca-certificates
5
7
6
8
WORKDIR $GOPATH/src/github.com/shellhub-io/shellhub
@@ -16,6 +18,8 @@ RUN go mod download
16
18
# builder stage
17
19
FROM base AS builder
18
20
21
+ ARG GOPROXY
22
+
19
23
COPY ./pkg $GOPATH/src/github.com/shellhub-io/shellhub/pkg
20
24
COPY ./api .
21
25
@@ -30,6 +34,9 @@ RUN go build
30
34
# development stage
31
35
FROM base AS development
32
36
37
+ ARG GOPROXY
38
+ ENV GOPROXY ${GOPROXY}
39
+
33
40
RUN apk add --update openssl build-base docker-cli
34
41
RUN go get github.com/markbates/refresh && \
35
42
go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.37.1 && \
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ services:
7
7
context : .
8
8
dockerfile : ssh/Dockerfile
9
9
target : development
10
+ network : host
11
+ args :
12
+ - GOPROXY=${SHELLHUB_GOPROXY}
10
13
volumes :
11
14
- ./ssh:/go/src/github.com/shellhub-io/shellhub/ssh
12
15
- ./pkg:/go/src/github.com/shellhub-io/shellhub/pkg
@@ -18,6 +21,9 @@ services:
18
21
context : .
19
22
dockerfile : api/Dockerfile
20
23
target : development
24
+ network : host
25
+ args :
26
+ - GOPROXY=${SHELLHUB_GOPROXY}
21
27
volumes :
22
28
- ./api:/go/src/github.com/shellhub-io/shellhub/api
23
29
- ./pkg:/go/src/github.com/shellhub-io/shellhub/pkg
@@ -28,6 +34,9 @@ services:
28
34
context : .
29
35
dockerfile : ui/Dockerfile
30
36
target : development
37
+ network : host
38
+ args :
39
+ - NPM_CONFIG_REGISTRY=${SHELLHUB_NPM_REGISTRY}
31
40
volumes :
32
41
- ./ui:/src
33
42
environment :
@@ -47,8 +56,11 @@ services:
47
56
context : .
48
57
dockerfile : agent/Dockerfile
49
58
target : development
59
+ network : host
50
60
args :
51
- SHELLHUB_VERSION : latest
61
+ - SHELLHUB_VERSION=latest
62
+ - GOPROXY=${SHELLHUB_GOPROXY}
63
+
52
64
privileged : true
53
65
network_mode : host
54
66
pid : host
Original file line number Diff line number Diff line change 1
1
# base stage
2
2
FROM golang:1.16.4-alpine3.13 AS base
3
3
4
+ ARG GOPROXY
5
+
4
6
RUN apk add --update git ca-certificates build-base openssh-client
5
7
6
8
WORKDIR $GOPATH/src/github.com/shellhub-io/shellhub
@@ -16,6 +18,8 @@ RUN go mod download
16
18
# builder stage
17
19
FROM base AS builder
18
20
21
+ ARG GOPROXY
22
+
19
23
COPY ./pkg $GOPATH/src/github.com/shellhub-io/shellhub/pkg
20
24
COPY ./ssh .
21
25
@@ -30,6 +34,9 @@ RUN go build -tags internal_api
30
34
# development stage
31
35
FROM base AS development
32
36
37
+ ARG GOPROXY
38
+ ENV GOPROXY ${GOPROXY}
39
+
33
40
RUN apk add --update openssl
34
41
RUN go get github.com/markbates/refresh && go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.37.1
35
42
Original file line number Diff line number Diff line change 1
1
FROM node:12.16.0-alpine as base
2
2
3
+ ARG NPM_CONFIG_REGISTRY
4
+
3
5
RUN apk add --update build-base python
4
6
5
7
WORKDIR /app
@@ -10,6 +12,9 @@ RUN npm install
10
12
11
13
FROM base as development
12
14
15
+ ARG NPM_CONFIG_REGISTRY
16
+ ARG ENV ${NPM_CONFIG_REGISTRY}
17
+
13
18
WORKDIR /src
14
19
15
20
COPY --from=base /app/node_modules /node_modules
@@ -20,6 +25,8 @@ CMD ["/scripts/entrypoint-dev.sh"]
20
25
21
26
FROM base as builder
22
27
28
+ ARG NPM_CONFIG_REGISTRY
29
+
23
30
WORKDIR /app
24
31
25
32
COPY ui/. .
You can’t perform that action at this time.
0 commit comments