1

I would like to avoid the following error. what should be the right way to do that. I could try to fix it by using python2-2.7.18-r0 instead of 2.7.16-r3. But the question is: will it be the future proof?

ERROR: unsatisfiable constraints:
  python2-2.7.18-r0:
    breaks: world[python=2.7.16-r3]
ERROR: Service 'frontend' failed to build: The command '/bin/sh -c apk add --no-cache make==4.2.1-r2 python=2.7.16-r3 g++=9.2.0-r4' returned a non-zero code: 1

Here is my Dockerfile:

FROM node:current-alpine as app-builder
ARG NODE_ENV
ENV NODE_ENV ${NODE_ENV}

RUN apk add --no-cache make==4.2.1-r2 python=2.7.16-r3 g++=9.2.0-r4
RUN mkdir -p /app
WORKDIR /app

COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

COPY . .
RUN yarn build
2
  • better to add your part of Dockerfile or way to reproduce it Commented May 8, 2020 at 12:13
  • @Adiii updated the question with dockerfile Commented May 8, 2020 at 12:21

1 Answer 1

1

Will it be future proof?

No. Python 2 is already end-of-lifed. It will not get any bug fixes and security issues will not be addressed. You should upgrade your application to Python 3, ideally before the Python 2 end-of-life date of 1 January 2020 (four months ago).

In terms of the Dockerfile you show, I'd avoid extremely specific version constraints like you have. Using the latest version of packages in a specific release of a Linux distribution is usually safe (code tested on Python 2.7.16-r3 will almost certainly run fine on Python 2.7.18-r0). You might want to pick a more specific distribution in your image's FROM line (for example, FROM node:14-alpine3.11) to minimize surprises.

Sign up to request clarification or add additional context in comments.

2 Comments

if we fix specific version distribution in docker file, doesn't that mean we are not getting any security update and making dockerfile vulnerable to attack?
If you target node:14-alpine-3.11, and occasionally docker build --pull, that tag gets updated to newer versions of Node 14.x (right now it is 14.2.0), so you will get updates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.