Error while creating docker image of azure-cli with Alpine linux as base image

1k views Asked by At

I am trying to create a Alpine docker image with azure-cli installed on it.

My docker files is as follow:

FROM alpine:3.4
RUN set -x \
        && apk update \
        && apk add --no-cache bash \
                              python \
                              curl \
                              coreutils \ 
                              openssl \
                              jq \
                              py-pip \
        && apk add --virtual=build \
                             gcc \
                             libffi-dev \
                             musl-dev \
                             libxml2-dev \
                             libxslt-dev \    
                             linux-headers \   
                             gcc \    
                             libffi \                        
                             openssl-dev \
                             python-dev \    
        && pip install azure-cli \    
        && apk del --purge build

When I run the docker build command, I get the following errors:

    config.status: creating src/libsodium/include/sodium/version.h
    config.status: creating test/default/Makefile
    config.status: creating test/Makefile
    config.status: executing depfiles commands
    config.status: executing libtool commands
    error: [Errno 2] No such file or directory

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ayCiZW/pynacl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3Yq3c3-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ayCiZW/pynacl/
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

What am I doing wrong here? Am I missing any dependencies?

2

There are 2 answers

0
Spaniard89 On

For anyone who is interested in re-using the docker file in the question above, you need to install make for it to work.

0
Shayne Boyer On

You could use the base docker image for the azure-cli and add to it. It is built on alpine. See: https://hub.docker.com/r/azuresdk/azure-cli-python/~/dockerfile/