Docker Alpine /bin/sh apk not found

后端 未结 2 1769
既然无缘
既然无缘 2020-12-31 04:04

I am building a new Docker image with:

FROM alpine:3.4
RUN apk upgrade --update

However, its failing with the error:

[INFO]         


        
相关标签:
2条回答
  • 2020-12-31 04:37

    I ran into something like this. It completely blew my mind, and I was questioning my sanity for a bit until I realized that /sbin wasn't in my container's PATH.

    If you type command -v apk in an interactive session in your container's base image and compare that directory with the container's $PATH that should get you squared away.

    If command -v apk doesn't work for you, you could try to find it via

    find / -name apk -type f -exec dirname "{}" ";"
    

    To the best of my knowledge this is always in /sbin. However you get there, just ensure that the apk binary's location is part of $PATH

    0 讨论(0)
  • 2020-12-31 04:38

    In the end we upgraded our projects to use this Docker Maven plugin: https://github.com/fabric8io/fabric8-maven-plugin. No issue thus far.

    0 讨论(0)
提交回复
热议问题