Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

45 lines
1.3KB

  1. # DOCKER-VERSION 17.12.0-ce, build c97c6d6
  2. # Pull alpine base image
  3. FROM alpine:latest AS codecbuilder
  4. # Configure build settings
  5. ENV LIBBPG_VERSION=0.9.8 \
  6. CPU_CORES=1
  7. # Fetch and extract bpg library
  8. RUN cd /tmp && \
  9. wget https://bellard.org/bpg/libbpg-${LIBBPG_VERSION}.tar.gz && \
  10. mkdir -p /opt/libbpg && \
  11. tar --strip-components=1 -xzf libbpg-${LIBBPG_VERSION}.tar.gz -C /opt/libbpg && \
  12. rm -f libbpg-${LIBBPG_VERSION}.tar.gz
  13. # Set current working directory
  14. WORKDIR /opt/libbpg
  15. # Set bpg build options
  16. ENV USE_EMCC=y \
  17. USE_JCTVC=y \
  18. USE_X265=
  19. # Install packages required to build codecs
  20. RUN apk add --update --no-cache \
  21. build-base cmake libpng-dev libjpeg-turbo-dev \
  22. sdl-dev sdl_image-dev yasm && \
  23. echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
  24. apk add --no-cache emscripten
  25. # Compile codecs in intermediate container
  26. RUN make -j ${CPU_CORES} && make install
  27. # Generate js file integrity hashes
  28. RUN apk add --update --no-cache openssl
  29. COPY ./bin/generate-hashes.sh .
  30. RUN chmod +x generate-hashes.sh && ./generate-hashes.sh
  31. # Move codecs and hashes into busybox container
  32. FROM busybox AS codecs
  33. COPY --from=codecbuilder /usr/local/bin/bpg* /usr/local/bin/
  34. COPY --from=codecbuilder /opt/libbpg/bpg*.js* /var/www/
  35. WORKDIR /usr/local/bin