Conversation
Codecov Report
@@ Coverage Diff @@
## master #606 +/- ##
=========================================
- Coverage 72.69% 72.4% -0.29%
=========================================
Files 54 54
Lines 2809 2765 -44
=========================================
- Hits 2042 2002 -40
+ Misses 508 506 -2
+ Partials 259 257 -2
Continue to review full report at Codecov.
|
872413a
to
f6e35d2
Compare
Dockerfile
Outdated
@@ -10,6 +10,7 @@ WORKDIR /go/src/github.com/docker/cli | |||
|
|||
RUN git clone https://github.com/docker/cli . && git checkout a1b83ffd2cbeefc0752e5aa7a543d49c1ddfd2cb | |||
|
|||
ARG GOPROXY=direct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Significant issue I see here is that this forces a value to GOPROXY, not just let us override the default one on purpose. Any suggestions for adequate docker build hack is welcome :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for the command-line argument, you can omit the value (and =
);
1. no --build-arg
docker build -<<'EOF'
FROM busybox
ARG GOPROXY
RUN env && exit 1
EOF
> [2/2] RUN env && exit 1:
#5 0.563 SHLVL=1
#5 0.563 HOME=/root
#5 0.563 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#5 0.563 PWD=/
2. with --build-arg=GOPROXY
, but no env-var set
docker build --build-arg=GOPROXY -<<'EOF'
FROM busybox
ARG GOPROXY
RUN env && exit 1
EOF
> [2/2] RUN env && exit 1:
#4 0.329 SHLVL=1
#4 0.329 HOME=/root
#4 0.329 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#4 0.329 PWD=/
3. with --build-arg=GOPROXY
and $GOPROXY
set as env-var
GOPROXY=direct docker build --build-arg=GOPROXY -<<'EOF'
FROM busybox
ARG GOPROXY
RUN env && exit 1
EOF
> [2/2] RUN env && exit 1:
#5 0.376 SHLVL=1
#5 0.376 HOME=/root
#5 0.376 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#5 0.376 GOPROXY=direct
#5 0.376 PWD=/
4. with value passed as --build-arg=GOPROXY=foobar
docker build --build-arg=GOPROXY=foobar -<<'EOF'
FROM busybox
ARG GOPROXY
RUN env && exit 1
EOF
> [2/2] RUN env && exit 1:
#5 0.327 SHLVL=1
#5 0.327 HOME=/root
#5 0.327 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#5 0.327 GOPROXY=foobar
#5 0.327 PWD=/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ndeloof - left some suggestions
docker.Makefile
Outdated
@@ -17,6 +17,10 @@ SCHEMAS_CTNR_NAME := $(BIN_NAME)-schemas-$(TAG) | |||
|
|||
BUILD_ARGS=--build-arg=EXPERIMENTAL=$(EXPERIMENTAL) --build-arg=TAG=$(TAG) --build-arg=COMMIT=$(COMMIT) --build-arg=ALPINE_VERSION=$(ALPINE_VERSION) | |||
|
|||
ifneq ($(GOPROXY),) | |||
BUILD_ARGS = $(BUILD_ARGS) --build-arg=GOPROXY=$(GOPROXY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it helps, but omitting the value (and the =
, because that implicitly is equal to =""
) will take the value from the current environment, so if GOPROXY
is not set as an environment variable, it won't be passed as a build-arg
--build-arg=GOPROXY
Dockerfile
Outdated
@@ -10,6 +10,7 @@ WORKDIR /go/src/github.com/docker/cli | |||
|
|||
RUN git clone https://github.com/docker/cli . && git checkout a1b83ffd2cbeefc0752e5aa7a543d49c1ddfd2cb | |||
|
|||
ARG GOPROXY=direct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for the command-line argument, you can omit the value (and =
);
1. no --build-arg
docker build -<<'EOF'
FROM busybox
ARG GOPROXY
RUN env && exit 1
EOF
> [2/2] RUN env && exit 1:
#5 0.563 SHLVL=1
#5 0.563 HOME=/root
#5 0.563 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#5 0.563 PWD=/
2. with --build-arg=GOPROXY
, but no env-var set
docker build --build-arg=GOPROXY -<<'EOF'
FROM busybox
ARG GOPROXY
RUN env && exit 1
EOF
> [2/2] RUN env && exit 1:
#4 0.329 SHLVL=1
#4 0.329 HOME=/root
#4 0.329 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#4 0.329 PWD=/
3. with --build-arg=GOPROXY
and $GOPROXY
set as env-var
GOPROXY=direct docker build --build-arg=GOPROXY -<<'EOF'
FROM busybox
ARG GOPROXY
RUN env && exit 1
EOF
> [2/2] RUN env && exit 1:
#5 0.376 SHLVL=1
#5 0.376 HOME=/root
#5 0.376 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#5 0.376 GOPROXY=direct
#5 0.376 PWD=/
4. with value passed as --build-arg=GOPROXY=foobar
docker build --build-arg=GOPROXY=foobar -<<'EOF'
FROM busybox
ARG GOPROXY
RUN env && exit 1
EOF
> [2/2] RUN env && exit 1:
#5 0.327 SHLVL=1
#5 0.327 HOME=/root
#5 0.327 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#5 0.327 GOPROXY=foobar
#5 0.327 PWD=/
@thaJeztah great suggestion, I didn't know about the |
Works the same for |
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- What I did
introduce support for GOPROXY
- How I did it
pass --build-arg according to local value.
set GOPROXY to
direct
for CI- How to verify it
No obvious way
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)