Last active
October 23, 2019 15:43
-
-
Save raveenb/a54878ed646830cccdef800b85e4c40f to your computer and use it in GitHub Desktop.
Fix Docker Debian Jessie issues. Dockerfile changes to get around the apt-get issue in Debian Jessie. Shamelessly copied and adapted from discussion on Stackoverflow here https://unix.stackexchange.com/questions/508724/failed-to-fetch-jessie-backports-repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.6-slim-jessie | |
MAINTAINER Raveen Beemsingh <[email protected]> | |
RUN apt-get update && \ | |
apt-get -y install cron curl redis-server sudo build-essential && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN adduser appuser | |
RUN echo "appuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
WORKDIR /home/appuser | |
COPY requirements.txt requirements.txt | |
RUN python -m venv venv | |
# jessie issue | |
RUN echo "deb [check-valid-until=no] http://cdn-fastly.deb.debian.org/debian jessie main" > /etc/apt/sources.list.d/jessie.list | |
RUN echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list | |
RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list | |
RUN apt-get -o Acquire::Check-Valid-Until=false update | |
# couchbase specific installations | |
RUN apt-get -y install lsb-release wget && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN lsb_release -a | |
RUN wget http://packages.couchbase.com/ubuntu/couchbase.key | |
RUN apt-key add couchbase.key | |
RUN touch /etc/apt/sources.list.d/couchbase.list | |
RUN echo "deb http://packages.couchbase.com/ubuntu stretch stretch/main" > /etc/apt/sources.list.d/couchbase.list | |
RUN wget http://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-4-amd64.deb | |
RUN dpkg -i couchbase-release-1.0-4-amd64.deb | |
RUN apt-get -o Acquire::Check-Valid-Until=false update && \ | |
apt-get -y install libcouchbase-dev && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN rm couchbase-release-1.0-4-amd64.deb couchbase.key | |
RUN venv/bin/pip install -r requirements.txt | |
COPY app app | |
COPY .env app.py boot.sh config.py cronjob tasks.py task_settings.py ./ | |
RUN chmod +x boot.sh | |
ENV FLASK_APP app.py | |
RUN chown -R appuser:appuser ./ | |
USER appuser | |
EXPOSE 5000 | |
ENTRYPOINT ["./boot.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://unix.stackexchange.com/questions/508724/failed-to-fetch-jessie-backports-repository