Build chromedriver for linux

后端 未结 1 1728
鱼传尺愫
鱼传尺愫 2021-01-16 23:32

I\'m trying to build chromedriver from source for use in selenium for Linux. i use this manual https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instr

相关标签:
1条回答
  • 2021-01-16 23:53

    We'd need more information... Here is a dockerfile (largely taken from here) that worked for me. Most of the commands come from the chromium build docs.

    FROM ubuntu:14.04
    
    # Install Chromium build dependencies.
    RUN echo "deb http://archive.ubuntu.com/ubuntu trusty multiverse" >> /etc/apt/sources.list # && dpkg --add-architecture i386
    RUN sudo apt-get update && apt-get install -qy git build-essential clang curl
    
    # Install Chromium's depot_tools.
    ENV DEPOT_TOOLS /usr/bin/depot_tools
    RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $DEPOT_TOOLS
    ENV PATH $PATH:$DEPOT_TOOLS
    RUN echo -e "\n# Add Chromium's depot_tools to the PATH." >> .bashrc
    RUN echo "export PATH=\"\$PATH:$DEPOT_TOOLS\"" >> .bashrc
    
    RUN git config --global https.postBuffer 1048576000
    
    # Download Chromium sources.
    RUN fetch --nohooks --no-history chromium
    
    WORKDIR /
    
    RUN gclient runhooks
    
    WORKDIR src
    
    RUN build/install-build-deps.sh --no-prompt
    
    RUN gn gen out/Release --args="is_debug=false"
    RUN ninja -C out/Release chromedriver
    
    RUN cp out/Release/chromedriver /usr/bin/chromedriver
    
    WORKDIR /
    
    0 讨论(0)
提交回复
热议问题