Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Compose Failing to Build Kakfa Image #319

Open
garystafford opened this issue Apr 19, 2018 · 10 comments
Open

Docker Compose Failing to Build Kakfa Image #319

garystafford opened this issue Apr 19, 2018 · 10 comments
Labels

Comments

@garystafford
Copy link

garystafford commented Apr 19, 2018

Running the commands, docker-compose up -d or the docker-compose -f docker-compose-single-broker.yml up, consistently fails on Docker build of the Kafka image.

System:
Windows 10 Enterprise
Docker Version 18.04.0-ce-win62 (17151)

$ docker-compose up -d
Building kafka
Step 1/11 : FROM openjdk:8u151-jre-alpine
 ---> b1bd879ca9b3
Step 2/11 : ARG kafka_version=1.1.0
 ---> Using cache
 ---> 2ceda394f7ce
Step 3/11 : ARG scala_version=2.12
 ---> Using cache
 ---> c6bcf9f30eae
Step 4/11 : ARG glibc_version=2.27-r0
 ---> Using cache
 ---> c41046a88202
Step 5/11 : MAINTAINER wurstmeister
 ---> Using cache
 ---> 9d3c464fd5ed
Step 6/11 : ENV KAFKA_VERSION=$kafka_version     SCALA_VERSION=$scala_version     KAFKA_HOME=/opt/kafka     GLIBC_VERSION=$glibc_version
 ---> Using cache
 ---> 06c606a469a2
Step 7/11 : ENV PATH=${PATH}:${KAFKA_HOME}/bin
 ---> Using cache
 ---> c70117277e66
Step 8/11 : COPY download-kafka.sh start-kafka.sh broker-list.sh create-topics.sh /tmp/
 ---> Using cache
 ---> 4a3caaaa856b
Step 9/11 : RUN apk add --no-cache bash curl jq docker  && mkdir /opt  && chmod a+x /tmp/*.sh  && mv /tmp/start-kafka.sh /tmp/broker-list.sh /tmp/create-topics.sh /usr/bin  && sync && /tmp/download-kafka.sh  && tar xfz /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -C /opt  && rm /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz  && ln -s /opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION} /opt/kafka  && rm /tmp/*  && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk  && apk add --no-cache --allow-untrusted glibc-${GLIBC_VERSION}.apk  && rm glibc-${GLIBC_VERSION}.apk
 ---> Running in 6de886aa39ab
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
(1/19) Installing pkgconf (1.3.10-r0)
(2/19) Installing ncurses-terminfo-base (6.0_p20171125-r0)
(3/19) Installing ncurses-terminfo (6.0_p20171125-r0)
(4/19) Installing ncurses-libs (6.0_p20171125-r0)
(5/19) Installing readline (7.0.003-r0)
(6/19) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(7/19) Installing libssh2 (1.8.0-r2)
(8/19) Installing libcurl (7.59.0-r0)
(9/19) Installing curl (7.59.0-r0)
(10/19) Installing libmnl (1.0.4-r0)
(11/19) Installing jansson (2.10-r0)
(12/19) Installing libnftnl-libs (1.0.8-r1)
(13/19) Installing iptables (1.6.1-r1)
(14/19) Installing device-mapper-libs (2.02.175-r0)
(15/19) Installing libltdl (2.4.6-r4)
(16/19) Installing libseccomp (2.3.2-r1)
(17/19) Installing docker (17.12.1-r0)
Executing docker-17.12.1-r0.pre-install
(18/19) Installing oniguruma (6.6.1-r0)
(19/19) Installing jq (1.5-r4)
Executing busybox-1.27.2-r7.trigger
OK: 232 MiB in 69 packages
/bin/sh: illegal option -
Service 'kafka' failed to build: The command '/bin/sh -c apk add --no-cache bash curl jq docker  && mkdir /opt  && chmod a+x /tmp/*.sh  && mv /tmp/start-kafka.sh /tmp/broker-list.sh /tmp/create-topics.sh /usr/bin  && sync && /tmp/download-kafka.sh  && tar xfz /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -C /opt  && rm /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz  && ln -s /opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION} /opt/kafka  && rm /tmp/*  && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk  && apk add --no-cache --allow-untrusted glibc-${GLIBC_VERSION}.apk  && rm glibc-${GLIBC_VERSION}.apk' returned a non-zero code: 2
@tenghuanhe
Copy link

tenghuanhe commented Apr 27, 2018

Same the condition, could anyone help?

@tenghuanhe
Copy link

Hi, @garystafford

I've found the solution, similar to PR#195

Under the project directory, run dos2unix *.sh will fix this problem.

@sscaling
Copy link
Collaborator

That PR may fix it - but there have been a number of different build failures on Windows reported, such as #146 - which has a different error message.

There are also docker compose options such as https://docs.docker.com/compose/reference/envvars/#compose_convert_windows_paths which may help. However, I don't have access to a Windows machine to reproduce and/or verify a fix.

@wagnertimo
Copy link

wagnertimo commented Jun 28, 2018

What helped me, since I was cloning the repo, was setting CLRF line endings to false. So I deleted the repo and called git config --global core.autocrlf false And re-cloned it again.

@rwagoner
Copy link

Under the project directory, run dos2unix *.sh will fix this problem.

This resolved it for me as well.

@zeekrey
Copy link

zeekrey commented Nov 15, 2018

What helped me, since I was cloning the repo, was setting CLRF line endings to false. So I deleted the repo and called git config --global core.autocrlf false And re-cloned it again.

Worked for me. Thank you! 👍

@c-jiang
Copy link

c-jiang commented Jan 3, 2019

What helped me, since I was cloning the repo, was setting CLRF line endings to false. So I deleted the repo and called git config --global core.autocrlf false And re-cloned it again.

Encountered the same error on Mac, and sorted out my gitconfig was autocrlf=true. After changing it to false, re-clone, and everything goes back correctly.

@ammills01
Copy link

What helped me, since I was cloning the repo, was setting CLRF line endings to false. So I deleted the repo and called git config --global core.autocrlf false And re-cloned it again.

Worked for me!

@Velliz
Copy link

Velliz commented Mar 7, 2019

I facing this problem. Because i uploaded cloned code from windows machine. But when trying cloned directly in my server (debian 9.5) the issue solved.

@Leviafan901
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants