mystikos
mystikos copied to clipboard
File descriptor of stdio does not support fcntl(F_GETFL/F_SETFL) or ioctl(TCGETS/TCSETS)
Python runtime invokes ioctl(TCGETS) on open fds.
Recent version of NodeJS calls fcntl(F_GETFL/F_SETFL) and ioctl(TCGETS/TCSETS) on stdio fds during initialization, and treat failures as fatal. Using the following NodeJs sample, the fatal failure reported by NodeJS can be reproduced.
docker file:
FROM node:13-alpine
WORKDIR /app
COPY app.js /app/app.js
CMD ["/bin/sh"]
app.js
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
Related #654