[Why] After `apt add ruby-dev` is executed, the `gem` command can be available.
And 'change gem source' should also be before executing 'gem install xxx'.
[Error Msg] Step 6/7 : RUN apk update && gem sources -r https://rubygems.org/ -a https://gems.ruby-china.com/ && apk upgrade && apk add--no-cache git && apk add ruby-dev make gcc g++ openssh ---> Running in 4c1f8708c072 fetch http://mirrors.huaweicloud.com/alpine/v3.8/main/aarch64/APKINDEX.tar.gz fetch http://mirrors.huaweicloud.com/alpine/v3.8/community/aarch64/APKINDEX.tar.gz v3.8.5-65-g097f0358a9 [http://mirrors.huaweicloud.com/alpine/v3.8/main] v3.8.5-37-gf06ffe835a [http://mirrors.huaweicloud.com/alpine/v3.8/community] OK: 9385 distinct packages available /bin/sh: gem: not found The command '/bin/sh -c apk update && gem sources -r https://rubygems.org/ -a https://gems.ruby-china.com/ && apk upgrade && apk add --no-cache git && apk add ruby-dev make gcc g++ openssh' returned a non-zero code: 127
Signed-off-by: Yu Chuan 13186087857@163.com --- container/git-mirror/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/container/git-mirror/Dockerfile b/container/git-mirror/Dockerfile index 2eac95c54ca1..127d0109d929 100644 --- a/container/git-mirror/Dockerfile +++ b/container/git-mirror/Dockerfile @@ -10,11 +10,11 @@ RUN adduser -u 1090 -D lkp RUN sed -ri.origin 's|^https?://dl-cdn.alpinelinux.org|http://mirrors.huaweicloud.com%7Cg' /etc/apk/repositories
RUN apk update && \ - gem sources -r https://rubygems.org/ -a https://gems.ruby-china.com/ && \ apk upgrade && \ apk add --no-cache git && \ apk add ruby-dev make gcc g++ openssh
RUN umask 002 && \ + gem sources -r https://rubygems.org/ -a https://gems.ruby-china.com/ && \ gem install bunny json PriorityQueue elasticsearch --no-rdoc --no-ri