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 build fails #1016

Closed
Gorillarock opened this issue Jan 5, 2022 · 4 comments
Closed

Docker build fails #1016

Gorillarock opened this issue Jan 5, 2022 · 4 comments
Labels
priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@Gorillarock
Copy link

Gorillarock commented Jan 5, 2022

System info

Operating System: macOS Catalina v. 10.15.7
Shaka Packager Version: e1b0c7c
Docker Version: Docker version 20.10.7, build f0df350

Issue and steps to reproduce the problem

Packager Command:

(1) run "docker build ."

What is the expected result?
Successful docker image built

What happens instead?
The [builder 9/10] RUN ninja -C src/out/Release step fails with this partial output around failure. (cannot find ares.h)

#14 106.8 FAILED: obj/third_party/curl/source/lib/libcurl.asyn-ares.o
#14 106.8 cc -MMD -MF obj/third_party/curl/source/lib/libcurl.asyn-ares.o.d -DV8_DEPRECATION_WARNINGS -DOpaqueSecTrustRef=__SecACL -DOpaqueSecTrustedApplicationRef=SecTrustedApplication -D_FILE_OFFSET_BITS=64 -DNO_TCMALLOC -DCHROMIUM_BUILD -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_NOTIFICATIONS -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -D__UCLIBC -DBUILDING_LIBCURL -DCURL_STATICLIB -DHTTP_ONLY -DUSE_IPV6 -DHAVE_CONFIG_H '-DCURL_CA_BUNDLE="/etc/ssl/cert.pem"' -DUSE_OPENSSL -DUSE_ARES -DUSE_LIBPCI=1 -DUSE_NSS_CERTS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../packager/third_party/curl/source/lib -I../../packager/third_party/curl/source/include -I../../packager/third_party/boringssl/src/include -I../../packager/third_party/curl/config -I../../packager/third_party/curl/config/curl -I../../packager/third_party/curl/config/linux -fstack-protector --param=ssp-buffer-size=4 -pthread -fno-strict-aliasing -Wno-extra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -Wno-error -m64 -march=x86-64 -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -c ../../packager/third_party/curl/source/lib/asyn-ares.c -o obj/third_party/curl/source/lib/libcurl.asyn-ares.o
#14 106.8 ../../packager/third_party/curl/source/lib/asyn-ares.c:76:12: fatal error: ares.h: No such file or directory
#14 106.8 76 | # include <ares.h>
#14 106.8 | ^~~~~~~~
#14 106.8 compilation terminated.
#14 106.9 [864/1680] CC obj/third_party/curl/source/lib/libcurl.curl_multibyte.o
#14 107.0 [865/1680] CXX obj/third_party/boringssl/src/ssl/boringssl.tls13_both.o
#14 107.1 [866/1680] CXX obj/third_party/boringssl/src/ssl/boringssl.tls13_client.o
#14 107.2 [867/1680] CXX obj/third_party/boringssl/src/ssl/boringssl.ssl_lib.o
#14 107.8 [868/1680] CXX obj/third_party/boringssl/src/ssl/boringssl.tls13_server.o
#14 108.1 [869/1680] CXX obj/third_party/boringssl/src/ssl/boringssl.t1_lib.o
#14 108.2 [870/1680] CXX obj/third_party/boringssl/src/ssl/boringssl.tls_record.o
#14 108.2 ninja: build stopped: subcommand failed.


copy of dockerfile:

FROM alpine:3.11 as builder

RUN apk add --no-cache
bash curl
bsd-compat-headers linux-headers
build-base git ninja python2 python3

WORKDIR /
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
ENV PATH $PATH:/depot_tools

RUN sed -i
'/malloc_usable_size/a \nstruct mallinfo {\n int arena;\n int hblkhd;\n int uordblks;\n};'
/usr/include/malloc.h
ENV GYP_DEFINES='musl=1'

ENV VPYTHON_BYPASS="manually managed python not supported by chrome operations"

WORKDIR shaka_packager
RUN gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged
COPY . src
RUN gclient sync --force
RUN ninja -C src/out/Release

FROM alpine:3.11
RUN apk add --no-cache libstdc++ python
COPY --from=builder /shaka_packager/src/out/Release/packager
/shaka_packager/src/out/Release/mpd_generator
/shaka_packager/src/out/Release/pssh-box.py
/usr/bin/

COPY --from=builder /shaka_packager/src/out/Release/pyproto /usr/bin/pyproto

@Gorillarock
Copy link
Author

Please fix this by adding "libexecinfo-dev c-ares-dev" to the apk add section of the dockerfile, as shown below:

FROM alpine:3.11 as builder

Install utilities, libraries, and dev tools.

RUN apk add --no-cache
bash curl
bsd-compat-headers linux-headers
build-base git ninja python2 python3 libexecinfo-dev c-ares-dev

Install depot_tools.

WORKDIR /
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
ENV PATH $PATH:/depot_tools

Alpine uses musl which does not have mallinfo defined in malloc.h. Define the

structure to workaround a Chromium base bug.

RUN sed -i
'/malloc_usable_size/a \nstruct mallinfo {\n int arena;\n int hblkhd;\n int uordblks;\n};'
/usr/include/malloc.h
ENV GYP_DEFINES='musl=1'

Bypass VPYTHON included by depot_tools, which no longer works in Alpine.

ENV VPYTHON_BYPASS="manually managed python not supported by chrome operations"

Build shaka-packager from the current directory, rather than what has been

merged.

WORKDIR shaka_packager
RUN gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged
COPY . src
RUN gclient sync --force
RUN ninja -C src/out/Release

Copy only result binaries to our final image.

FROM alpine:3.11
RUN apk add --no-cache libstdc++ python
COPY --from=builder /shaka_packager/src/out/Release/packager
/shaka_packager/src/out/Release/mpd_generator
/shaka_packager/src/out/Release/pssh-box.py
/usr/bin/

Copy pyproto directory, which is needed by pssh-box.py script. This line

cannot be combined with the line above as Docker's copy command skips the

directory itself. See moby/moby#15858 for details.

COPY --from=builder /shaka_packager/src/out/Release/pyproto /usr/bin/pyproto

@joeyparrish
Copy link
Member

Thanks, @Gorillarock. Can you send a PR with that change?

@joeyparrish joeyparrish added the type: bug Something isn't working correctly label Mar 8, 2022
@github-actions github-actions bot added this to the v2.6 milestone Mar 8, 2022
@joeyparrish
Copy link
Member

@Gorillarock, can you try again with the latest code in the main branch? I believe this has been resolved. The main Dockerfile and most of the distro-specific docker tests are working now.

@joeyparrish joeyparrish modified the milestones: v2.6, v2.7 Jun 24, 2022
@joeyparrish joeyparrish added the priority: P1 Big impact or workaround impractical; resolve before feature release label Jun 24, 2022
@joeyparrish
Copy link
Member

No feedback since March, and we believe this is solved. Please reopen if not. Thanks!

Build System Overhaul automation moved this from To Do to Done Oct 18, 2022
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Dec 17, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
No open projects
Development

No branches or pull requests

2 participants