Path: blob/main/tools/docker/updateSeccompProfile.js
1028 views
const Https = require('https');1const Fs = require('fs');23const extraPermissions = {4comment: 'Allow create user namespaces',5names: ['clone', 'setns', 'unshare'],6action: 'SCMP_ACT_ALLOW',7args: [],8includes: {},9excludes: {},10};1112Https.get('https://raw.githubusercontent.com/docker/engine/master/profiles/seccomp/default.json')13.on('response', async response => {14let json = '';15for await (const chunk of response) {16json += chunk.toString();17}18const defaultProfile = JSON.parse(json);19defaultProfile.syscalls.unshift(extraPermissions);20Fs.writeFileSync(21`${__dirname}/docker_seccomp_profile.json`,22JSON.stringify(defaultProfile, null, 2),23);24})25.end();262728