-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update documentation to clarify REPL usage and security implications #9
Comments
The real was definitely working for me, but I was installing all the deps that apple was suggesting. Should we put those deps back for completeness sake? We might be breaking other parts of the toolchain without knowing it but not having deps apple details in their docs. Perhaps revert that commit and see what happens? |
@swizzlr yeah what you're saying makes sense, checking it out |
@hamin just tried "reverting" those changes and no dice. are you sure it worked for you, back then? maybe it's flaky? |
@swizzlr its working for me. I'm running latest master |
@swizzlr what were you trying to run exactly? |
@swizzlr argh sorry its not running for me...i was running my old docker image...gimme a few |
@swizzlr confirmed this master is not working for me...the above screenshot was from my original repo. It definitely worked |
Does this commit work 369c495 ? |
@swizzlr checking it out. Meanwhile do a docker pull from here https://hub.docker.com/r/harisamin/docker-swift/
Try that and see if it works there |
Nope, not working on this (digital ocean VM hooked up with docker-machine).
|
|
wtf how is it working for me then from my original image. you're just typing |
We need a third person to try this out to figure out which of our machines is wrong. The image ID is |
@swizzlr master on our repo:
Checking if there's a new tar, maybe apple removed the old one |
@swizzlr lol the link is dead: https://swift.org/builds/ubuntu1404/swift-2.2-SNAPSHOT-2015-12-01-b/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04.tar.gz Got it from here: https://swift.org/download/ |
On my own docker implementation I had user reporting the same issue. Funny thing is it work for my docker on VM. |
@lxcid That's fascinating! Do you think you could find out what the implementations are? Maybe this is a TTY thing? I was interested in creating a |
I'm trying to build from source at the moment though. Its painfully slow, maybe its because I'm building a release build. Use the following python (2.7) script https://github.com/apple/swift/blob/master/utils/build-script I'm not sure if I can wait until it complete but I'll keep you updated on my finding. |
root@ab75a4cb7eff:/usr/src/swift# ./build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift --version
Swift version 2.2-dev (LLVM 46be9ff861, Clang 4deb154edc, Swift c959ce2c83)
Target: x86_64-unknown-linux-gnu
root@ab75a4cb7eff:/usr/src/swift# ./build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift
LLVM ERROR: Compiler-internal integrated REPL unimplemented for this platform This is the output of the release build. I'm doing another debug build at the moment. |
@lxcid do u mind trying the latest master? I've tested the current master on my local docker instances and am able to launch the repl without issue. Let us know :) |
I just tried the latest master fb7ff42 but it still have the same error in Digital Ocean docker. I suspect it is the binary that have issue. |
@hamin you running it on your MB in boot2docker? |
Im running swift docker image: swiftdocker/swift:836d5b4ca56e and it works fine on both linux and osx machines. Locally (on osx) im using docker-machine and can run REPL with this command:
|
this one is tough and has been haunting us forever :) . Not sure what to do here, in the Github readme we have privileged noting that ppl use containers locally for development too and not just for deployments, places where a Swift repl is more needed or helpful. I think we decided to exclude them from the Docker hub documentation specifically for containers on linux servers concern. I think this was also pointed to us out by Docker team when we were merging the project in the official images section that they maintain. |
Unfortunately, even with |
Ah, so there's likely something in the default seccomp profile and/or
apparmor profile blocking it now.
|
Confirmed, I can run the REPL with just "--security-opt
seccomp=unconfined" (and no other options).
Now to narrow down what exactly is required for it to work that the
default profile blocks.
|
Ok, here's what I've had success with: (where --- default.json 2017-09-08 15:02:37.061507178 -0700
+++ swift.json 2017-09-08 15:02:54.821989684 -0700
@@ -216,6 +216,7 @@
"open",
"openat",
"pause",
+ "personality",
"pipe",
"pipe2",
"poll", $ docker run -it --rm --security-opt seccomp=swift.json --cap-add sys_ptrace swift swift
Welcome to Swift version 3.1 (swift-3.1-RELEASE). Type :help for assistance.
1> |
Should we even be supporting repl in the official image? If things like text editors are excluded, everything except the core compiler and runtime should be excluded right? The purpose of this image is execution, not dev support. |
So what is the way to make this docker work? As I keep getting |
@jonauz If the Readme instructions aren't working for you, please open a separate issue. This issue tracks the fact that the REPL fails without elevated security privileges. |
Action item: me to update Readme and sync it with official repo README. |
I get this: docker run --cap-add sys_ptrace -it --rm swift swift I see from above I should perhaps open a new issue? |
@fekerr it likely also needs a slightly customised seccomp profile, as I noted above (#9 (comment)) |
@swizzlr We are moving Swift Docker issues to https://bugs.swift.org Component: Docker. Can you please file your issue on bugs.swift.org? We are planning on closing GitHub swift-docker issues on Dec 20th, 2018 (PST). |
Adding |
When I add --cap-add sys_ptrace the image never gets created. |
Hi, I just tried today and this worked for me! |
As @tianon comment for --privileged maybe
better than
|
I've gotten it working with only one change to the seccomp profile.
My change to the default seccomp profile:
Allowing ADDR_NO_RANDOMIZE by default was requested in moby/moby#43011, but the answer was to maintain your own seccomp profile. |
Overview
Swift REPL requires LLDB. LLDB requires some elevated privileges.
Objectives
The text was updated successfully, but these errors were encountered: