我想在docker / local / bin下的docker中安装[chisel] [1],然后尝试以下操作,但出现错误

RUN curl -L https://github.com/jpillora/chisel/releases/download/1.3.1/chisel_linux_amd64.gz | gzip -d - > /usr/local/bin && \

错误是:
/bin/sh: can't create /usr/local/bin: Is a directory
curl: (23) Failed writing body (0 != 16360)

但这是目录...。知道如何将其添加到我的图像中吗?

我正在使用docker alpine:3.10.1
我也试过了
RUN curl -sSL https://github.com/jpillora/chisel/releases/download/1.3.1/chisel_linux_amd64.gz | gzip -d - > /usr/local/bin/chisel && \
    chmod +x /usr/local/bin/chisel


并得到错误:
/bin/sh: can't create /usr/local/bin/chisel: Permission denied
curl: (23) Failed writing body (0 != 16360)

```


https://github.com/jpillora/chisel


  [1]: https://github.com/jpillora/chisel

最佳答案

您可以使用此:

FROM alpine
RUN apk update && apk add --no-cache wget
RUN cd  /usr/local/bin && wget  https://github.com/jpillora/chisel/releases/download/1.3.1/chisel_linux_amd64.gz && gzip -d chisel_linux_amd64.gz
RUN mv /usr/local/bin/chisel_linux_amd64 /usr/local/bin/chisel && chmod +x /usr/local/bin/chisel
RUN chisel -v

结果:
ls /usr/local/bin/
chisel

09-11 13:08