Created
November 21, 2019 18:01
-
-
Save peteristhegreat/d633832ec987eb47f371a956e7b6e50b to your computer and use it in GitHub Desktop.
Connect Julia from inside Docker to outside
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Start the docker container: | |
# docker run -dit -p 9009:9009 --name mytest julia:1.0 | |
## Enter the docker container | |
# docker exec -it mytest bash | |
using Sockets; l = listen(IPv4(0),9009); accept(l) | |
## Expected output | |
# (Blocks until a connection comes thru) | |
# TCPSocket(RawFD(0x00000014) open, 0 bytes waiting) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sockets; connect(9009) | |
# TCPSocket(RawFD(0x00000016) open, 0 bytes waiting) | |
## Verify the connection using netstat | |
# netstat -ac | grep 9009 | |
# netstat -ac | grep tcp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment