none
Failed to fetch https://packages.microsoft.com/debian/9/prod/dists/stretch/main/binary-amd64/Packages.bz2 File has unexpected size (72896 != 72828) RRS feed

  • Question

  • Receiving the following error when building sql server in docker php image:

    ```

    Reading package lists...
    E: Failed to fetch https://packages.microsoft.com/debian/9/prod/dists/stretch/main/binary-amd64/Packages.bz2  File has unexpected size (72896 != 72828). Mirror sync in progress? [IP: 40.76.35.62 443]
       Hashes of expected file:
        - Filesize:72828 [weak]
        - SHA512:3e2135a607d82f3d0fb22a952998f1306ce456553daedb681bee125507c96d0b6e6429b110c92ae9cef8ae09974c74fbabb4e28aeab32ebed9962d2c61238686
        - SHA256:4217b6ad3a63657ec03df9a3f95c0c5a55401f760790b48269e80dcf6ac19171
        - SHA1:5b709f4947671085a4172e9d90248fef90be7355 [weak]
        - MD5Sum:3564888127c08fa04b2b27e345507089 [weak]
       Release file created at: Tue, 21 Jan 2020 18:06:13 +0000
    E: Some index files failed to download. They have been ignored, or old ones used instead.

    ```

    Dockerfile

    ```

    FROM php:7.4-fpm as jobs

    # Set timezone to America/New_York
    ENV TZ=America/New_York
    ENV php_vars /usr/local/etc/php/conf.d/docker-vars.ini

    RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
      && echo $TZ > /etc/timezone \
      && echo "date.timezone=\"$TZ\"" >> /usr/local/etc/php/conf.d/docker-vars.ini

    RUN apt-get update && \
      apt-get install -y --no-install-recommends gnupg \
      apt-transport-https \
      cron \
      gettext \
      libicu-dev \
      wget \
      && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -  && \
      curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
      apt-get update && \
      ACCEPT_EULA=Y apt-get install -y --no-install-recommends \
      msodbcsql17=17.4.2.1-1 \
      mssql-tools=17.4.1.1-1 \
      locales && \ 
      ln -sfn /opt/mssql-tools/bin/sqlcmd /usr/bin/sqlcmd && \
      ln -sfn /opt/mssql-tools/bin/bcp /usr/bin/bcp && \
      echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
      locale-gen && \
      rm -r /var/lib/apt/lists/*

    RUN rm -f /usr/lib/x86_64-linux-gnu/libodbcinst.so* && \
      rm -f /usr/lib/x86_64-linux-gnu/libodbc.so* && \
      wget http://www.unixodbc.org/unixODBC-2.3.7.tar.gz && \
      echo "274a711b0c77394e052db6493840c6f9  unixODBC-2.3.7.tar.gz" | md5sum -c - && \
      tar -xzf unixODBC-2.3.7.tar.gz && \
      cd unixODBC-2.3.7 && \
      ./configure --prefix=/usr/local --libdir=/usr/local/lib --sysconfdir=/etc --disable-gui --disable-drivers --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE && \
      make && \
      make install && \
      ldconfig

    RUN docker-php-ext-install -j$(nproc) intl opcache

    RUN pecl install sqlsrv-5.7.1preview pdo_sqlsrv-5.7.1preview apcu && \
      docker-php-ext-enable sqlsrv pdo_sqlsrv apcu

    COPY conf/odbcinst.ini /etc/odbcinst.ini

    RUN ln -s /usr/local/bin/php /usr/bin/php
    RUN mv $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini && \ 
      echo "log_errors = On"  >> ${php_vars} && \
      echo "display_errors = On"  >> ${php_vars} && \
      echo "error_log = /proc/1/fd/2" >> ${php_vars} && \
      echo "display_startup_errors = On" >> ${php_vars} 

    RUN mkdir /usr/src/app
    WORKDIR /usr/src/app

    COPY . .
    COPY src/jobs/crontab /etc/cron.d/jobs-cron
    RUN chmod 755 /etc/cron.d/jobs-cron
    RUN crontab /etc/cron.d/jobs-cron
    RUN chmod +x src/jobs/start.sh

    RUN touch /usr/src/app/src/crunz

    ENV TINI_VERSION v0.18.0
    ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
    ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
    RUN chmod +x /tini

    ENTRYPOINT [ "./entrypoint-jobs.sh" ]
    CMD ["src/jobs/start.sh"]

    FROM jobs as debug

    # xdebug configuration
    RUN pecl install xdebug && docker-php-ext-enable xdebug \
      && echo "xdebug.remote_port=9010" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
      && echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
      && echo "xdebug.remote_connect_back=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
      && echo "xdebug.remote_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
      && echo "xdebug.idekey=VSCODE" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
      && echo "xdebug.remote_autostart=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
      && echo "xdebug.remote_log=/tmp/xdebug.log" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.in

    ```

    Tuesday, January 21, 2020 6:35 PM