Hi all, I’m running a Jupyter docker image (Jupyter Docker Stacks — Docker Stacks documentation) and I want to embed the notebook into an iframe on a different website (all on localhost). Currently, when I do so, I get the error "Refused to frame ‘http://localhost:54437/’ because an ancestor violates the following Content Security Policy directive: “frame-ancestors ‘self’”. How can I modify the content security policy configuration of the docker image so that it can run in an iframe?
Figured it out, have to add a command line argument to the Cmd
param in the container config when creating the container (cli.ContainerCreate
) e.g.
container.Config{
...
Cmd: strslice.StrSlice{"start-notebook.py", "--NotebookApp.tornado_settings={\"headers\":{\"Content-Security-Policy\": \"frame-ancestors *;\"}}"},
...
},
Maybe the “start-notebook.py” part isn’t even needed, haven’t tried removing it.