On Sat, Jan 30, 2021 at 10:56:04PM +0800, Cao Xueliang wrote:
On Sat, Jan 30, 2021 at 09:28:01AM +0800, Yu Chuan wrote:
[Why] After `apt add ruby-dev` is executed, the `gem` command can be available.
[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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/container/git-mirror/Dockerfile b/container/git-mirror/Dockerfile index 2eac95c54ca1..18613eddf30e 100644 --- a/container/git-mirror/Dockerfile +++ b/container/git-mirror/Dockerfile @@ -10,10 +10,10 @@ 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
- apk add ruby-dev make gcc g++ openssh && \
- gem sources -r https://rubygems.org/ -a https://gems.ruby-china.com/
Move the line above gem install will be better.
apk update: update the local apk source. apk upgrade: upgrade all installed pkg.
Why not add new pkg after apk update and apk upgrade?
-------- Thanks Yu Chuan
Thanks, Xueliang
RUN umask 002 && \ gem install bunny json PriorityQueue elasticsearch --no-rdoc --no-ri -- 2.23.0