HyukHyukBoi
HyukHyukBoi

Reputation: 463

Error in Dockerfile while running command-->docker logs test-client

can someone tell me the error in the Dockerfile given below: I am trying to follow instructions given in this repo: https://github.com/anthcourtney/docker-consul-template-haproxy

FROM alpine:3.4


RUN apk --update add python py-pip && \
    pip install pytest requests 
ADD test_http.py /tmp

CMD ["pytest", "/tmp"]

The complete log is:

Building test
Step 1/4 : FROM alpine:3.4
 ---> b7c5ffe56db7
Step 2/4 : RUN apk --update add python py-pip &&     pip install pytest requests
 ---> Running in b3f06fa34b2e
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
(1/12) Installing libbz2 (1.0.6-r5)
(2/12) Installing expat (2.2.0-r1)
(3/12) Installing libffi (3.2.1-r2)
(4/12) Installing gdbm (1.11-r1)
(5/12) Installing ncurses-terminfo-base (6.0_p20171125-r0)
(6/12) Installing ncurses-terminfo (6.0_p20171125-r0)
(7/12) Installing ncurses-libs (6.0_p20171125-r0)
(8/12) Installing readline (6.3.008-r4)
(9/12) Installing sqlite-libs (3.13.0-r2)
(10/12) Installing python (2.7.14-r0)
ERROR: python-2.7.14-r0: BAD archive            /***signature also in place of archive***/
(11/12) Installing py-setuptools (20.8.0-r0)
(12/12) Installing py-pip (8.1.2-r0)
Executing busybox-1.24.2-r14.trigger
1 errors; 23 MiB in 22 packages
ERROR: Service 'test' failed to build: The command '/bin/sh -c apk --update add python py-pip &&     pip install pytest requests' returned a non-zero code: 1

Any fix for this?

Upvotes: 0

Views: 113

Answers (1)

Munish
Munish

Reputation: 1627

Problem here is with the alpine image version, try it using the latest tag or any other tag latest py-pip is compatible with.

FROM alpine:latest

RUN apk --update add python py-pip && \
    pip install pytest requests 
ADD test_http.py /tmp

CMD ["pytest", "/tmp"]

You can also find and try to install a py-pip version compatible with alpine 3.4 version.

Upvotes: 2

Related Questions