Hi all
I am using Ubuntu 16.04; I am trying to run a nodejs program from docker. Within this program I need to be able to spawn a python script (which is only compatible with python 3.6 and above).
In order to test that the correct version of python is being used from within the node program I have a very simple piece of code
const { spawn } = require('child_process');
var proc = spawn('python3', ['--version']);
proc.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
However, try as I might, this program always produces the output:
stdout: Python 3.5.3
I have been unable to find a way to get the version of python up to 3.6
My Dockerfile:
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa && apt-get update && apt-get install -y python3.7 python3.7-dev python3-pip
RUN ln -sfn /usr/bin/python3.7 /usr/bin/python3 && ln -sfn /usr/bin/python3 /usr/bin/python && ln -sfn /usr/bin/pip3 /usr/bin/pip
FROM node:12
ADD demo ./demo
ADD aries_cloudagent ./aries_cloudagent
ADD ./demo/runners/nodejs/ ./nodejs
ADD bin ./bin
RUN npm install --prefix ./nodejs
CMD node ./nodejs/alice.js
`
I get the same result regardless of whether the first two RUN lines are there: they seem to have no effect.
I am at a loss to know how to fix this. Any ideas?