How to connect expo go app through docker devcontainer - docker

problem
cannot connect with my expo app to the expo simulation
setup
set up a devcontainer with vscode's extension.
login into my expo account
successful build
expo go and laptop in the same network
has worked before with last linux pc
node -e 'console.log(os.networkInterfaces())' results:
{
lo: [
{
address: '127.0.0.1',
netmask: '255.0.0.0',
internal: true,
cidr: '127.0.0.1/8',
...
}
],
eth0: [
{
address: '172.17.0.3',
netmask: '255.255.0.0',
internal: false,
cidr: '172.17.0.3/16',
...
}
]
I tried
setting REACT_NATIVE_PACKAGER_HOSTNAME to host's ip
without it gives me a link from its eth0
open mac's firewall to vscode and docker
turn off mac's firewall
switch to tunnel connection
but this gives an error for another question later
tried posting and currently waiting responses here while exercising my google-fu
my environment
mac os 12.3 (monterey)
docker 4.7.1
devcontainer from microsoft's nodejs (alpine with node)
expo cli version: v5.3.2
previous environment
ubuntu 21.04
docker ~4.7.1
devcontainer from microsoft's nodejs (alpine with node)
expo cli version: ~5.3.2
to reproduce
setup a devcontainer
"VARIANT": "14-bullseye"
"features": {"git": "latest","aws-cli": "latest","desktop-lite": "latest","python": "latest" }
npm i -g expo-cli
expo init a new sample project
expo start
try to connect expo go via the qr
no errors on expo-cli but go-app java.net.ConnectException: Failed to connect to /192.x.x.x:19000
if not working like me:
close expo
export REACT_NATIVE_PACKAGER_HOSTNAME=192.168.1.xxx xxx is host's lan ip address
expo start
try connecting with expo go app via qr
no errors on expo-cli but go-app java.net.ConnectException: Failed to connect to /192.x.x.x:19000

Related

VSCode devcontainer: proxy: unknown scheme: http

i have some troubles starting devcontainers in VSCode.
My setup:
macOS (Monterey 12.6.2)
docker-ce on local VM (DOCKER_HOST: ssh://vagrant#127.0.0.1:2222)
corporate proxy configured via http_proxy & https_proxy & no_proxy env variables (also the uppercased variants)
VSCode (1.74.3)
no Docker-Desktop
I have created a very small example with just the devcontainer definition. Nothing else is in the project folder:
# .devcontainer/devcontainer.json
{
"name": "Example DevContainer",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"customizations": {
"vscode": {
"settings": {
"docker.environment": {
"DOCKER_HOST": "ssh://vagrant#127.0.0.1:2222"
}
}
}
}
}
when i now start the dev container using: Dev Containers: Rebuild and Reopen in Container (or any other dev container related command) i receive only the following error:
[650908 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[651092 ms] Stop (184 ms): Run: docker version --format {{.Server.APIVersion}}
[651093 ms] proxy: unknown scheme: http
I have configured VSCode to use the vm as docker host:
Im not sure where to start troubleshooting. Any ideas?
EDIT: Interesting side fact: if i run Dev Containers: Try a Dev Container Sample... the sample dev container starts building, but seems to fail since the corporate proxy is not configured in the image, but at least ist starts to build and not aborts directly with the error above.
Dev Containers: Create Dev Container... immediately fails too with the error above.

Docker wont launch on Windows 11

I'm going crazy; I have spent way too much time and would immensely appreciate any help.
Here's the problem:
When I launch Docker Desktop, the engine stays on Stopped, and never launches.
I'm on Windows 11
I've installed the WSL 2 backend (following these steps), noticed Hyper-V was not installed so I installed it
I've tried to uninstall and reinstall docker desktop
I've tried to launch docker desktop as admin
I've tried using: 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon
I'm really stuck.
When I run self diagnose:
"C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check
I get this (trimmed a bit to comply to character limit):
[044:20:57:56.119][I] ipc.NewClient: e7c958f3-com.docker.diagnose -> \\.\pipe\dockerBackendV2 com.docker.service.exe
[goroutine 1 [running, locked to thread]:
[win/backend/pkg/service.NewClientForPath(...)
[ win/backend/pkg/service/service.go:42
[win/backend/pkg/service.NewClient({0x15cf112, 0x13}, {0x0, 0x0, 0x0})
[ win/backend/pkg/service/service.go:31 +0xd0
[common/pkg/diagkit/gather/diagnose.init()
[ common/pkg/diagkit/gather/diagnose/ipc_windows.go:23 +0x11f
Starting diagnostics
[PASS] DD0027: is there available disk space on the host?
[SKIP] DD0028: is there available VM disk space?
[FAIL] DD0031: does the Docker API work? error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine_linux/v1.24/containers/json?limit=0": open //./pipe/docker_engine_linux: The system cannot find the file specified.
[FAIL] DD0004: is the Docker engine running? Get "http://ipc/docker": open \\.\pipe\dockerLifecycleServer: The system cannot find the file specified.
[044:20:57:56.176][I] ipc.NewClient: e90d0409-com.docker.diagnose -> \\.\pipe\dockerLifecycleServer VMDockerdAPI
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0001: is the application running?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0002: does the bootloader have virtualization enabled?
[PASS] DD0020: is the Hyper-V Windows Feature enabled?
[PASS] DD0017: can a VM be started?
[PASS] DD0015: are the binary symlinks installed?
error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json": open //./pipe/docker_engine: The system cannot find the file specified.
[FAIL] DD0003: is the Docker CLI working? exit status 1
[PASS] DD0013: is the $PATH ok?
[PASS] DD0005: is the user in the docker-users group?
[PASS] DD0007: is the backend responding?
[FAIL] DD0014: are the backend processes running? 3 errors occurred:
* vpnkit-bridge.exe is not running
* vpnkit.exe is not running
* com.docker.proxy.exe is not running
[PASS] DD0008: is the native API responding?
[FAIL] DD0009: is the vpnkit API responding? open \\.\pipe\dockerVpnKitDiagnostics: The system cannot find the file specified.
[FAIL] DD0010: is the Docker API proxy responding? failed to ping Docker proxy API with error: Get "http://ipc/desktop-diagnostics/ping": open \\.\pipe\dockerDesktopLinuxEngine: The system cannot find the file specified.
[044:20:58:05.735][I] ipc.NewClient: dcada6c0-diagnose -> \\.\pipe\dockerDesktopLinuxEngine Proxy
[044:20:58:14.888][I] (a6e3c814-3) 6b92eeae-diagnose-network C->S diagnosticsd GET /ping
[044:20:58:14.888][E] (a6e3c814-3) 6b92eeae-diagnose-network C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.
[044:20:58:16.899][I] (a6e3c814-5) 6b92eeae-diagnose-network C->S diagnosticsd GET /ping
[044:20:58:16.899][E] (a6e3c814-5) 6b92eeae-diagnose-network C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.
[FAIL] DD0032: do Docker networks overlap with host IPs? error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine_linux/v1.24/networks": open //./pipe/docker_engine_linux: The system cannot find the file specified.
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0033: does the host have Internet access?
Please investigate the following 3 issues:
1 : The test: are the LinuxKit services running?
Failed with: failed to ping VM diagnosticsd with error: Get "http://ipc/ping": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.
The Docker engine runs inside a Linux VM as a service. Therefore the services must have started.
2 : The test: are the backend processes running?
Failed with: 3 errors occurred:
* vpnkit-bridge.exe is not running
* vpnkit.exe is not running
* com.docker.proxy.exe is not running
Not all of the backend processes are running.
3 : The test: is the VM networking working?
Failed with: network checks failed: Post "http://ipc/check-network-connectivity": open \\.\pipe\dockerDiagnosticd: The system cannot find the file specified.
VM seems to have a network connectivity issue. Please check your host firewall and anti-virus settings in case they are blocking the VM.
I've authorized Docker Desktop through the firewall, but it didn't change anything. I'd be so grateful for any help!
I payed Docker Pro subscription to contact the support and got this answer that SOLVED it ! Pfiew I had really tried everything, couldn't have guessed that.
The answer :
Hi,
We have identified an issue in Docker Desktop 4.5.0 where the default backend selected after installing is not the correct one.
We will release a Docker Desktop 4.5.1 shortly to address this, in the meanwhile you can switch to the correct backend by editing the following file:
%APPDATA%\Docker\settings.json and at the bottom change the value for the wslEngineEnabled field to true.
After that Docker Desktop should start correctly.
Sorry for the inconvenience
And it worked !!

Dockerized nmap shows incorrect OS versions

I've noticed that when Nmap is dockerized it is yielding incorrect OS results. I've tried various pre-built docker images as well as one I created myself and they all show the same results.
Here are a few of the pre-built images I've tried:
https://hub.docker.com/r/instrumentisto/nmap
https://hub.docker.com/r/uzyexe/nmap/
I've run the same Nmap command with these images and using my locally installed Nmap version and here are the results (all images are using Nmap 7.80):
$ nmap -sV -O 192.168.1.1
------(locally installed nmap result - correct):
OS CPE: cpe:/o:linux:linux_kernel:2.6
OS details: Linux 2.6.8 - 2.6.30
Network Distance: 1 hop
Service Info: OS: Linux; Device: broadband router; CPE: cpe:/o:linux:linux_kernel
------(all docker image nmap results - incorrect):
OS CPE: cpe:/h:hp:jetdirect_170x cpe:/h:hp:inkjet_3000
Aggressive OS guesses: HP 170X print server or Inkjet 3000 printer (85%), HP LaserJet 4000 printer (85%), HP LaserJet 4250 printer (85%)
No exact OS matches for host (test conditions non-ideal).
Service Info: OS: Linux; Device: broadband router; CPE: cpe:/o:linux:linux_kernel
What's interesting to me is that the Service Info is actually correct across the scans, but nothing else is.
I'm trying to figure out of there is a setting/flag that I'm missing when executing the docker command. Here's what I've tried:
Setting the docker network to host (no change in result)
Setting the docker network to bridge (no change in result)
Not setting any network setting (no change in result)
I really need to get Nmap working in a docker container because it's integrated into a rails web app that I'm building utilizing the ruby-nmap gem.
Thanks!

Running hyperledger composer playground locally causes an Error

I am working on a tutorial on Hyperledger Composer (https://www.ibm.com/developerworks/cloud/library/cl-deploy-interact-extend-local-blockchain-network-with-hyperledger-composer/index.html). It uses docker to run local version of hyperledger composer playground.
The first time I ran it on localhost 8080, it worked fine, but then a few days later but I run it, it throws an error:
TypeError: Cannot read property 'engine' of undefined
This is what I see on the command line:
[2018-03-16 05:40:53] PM2 log: Launching in no daemon mode
[2018-03-16 05:40:53] PM2 log: Starting execution sequence in -fork mode- for app name:composer-playground id:0
[2018-03-16 05:40:53] PM2 log: App name:composer-playground id:0 online
PlaygroundAPI :createServer() > 8080, false
PlaygroundAPI :createServer() Playground API started on port 8080
PlaygroundAPI :createServer() <
Composer :main() >
PlaygroundAPI :createServer() Client with ID 'zIhEA8HiUwbYafauAAAA' on host '::ffff:172.17.0.1' connected
ConnectorServer :constructor() > {"fs":{"constants":{"O_RDONLY":0,"O_WRONLY":1,"O_RDWR":2,"S_IFMT":61440,"S_IFREG":32768,"S_IFDIR":16384,"S_IFCHR":8192,"S_IFBLK":24576,"S_IFIFO":4096,"S_IFLNK":40960,"S_IFSOCK":49152,"O_CREAT":64,"O_EXCL":128,"O_NOCTTY":256,"O_TRUNC":512,"O_APPEND":1024,"O_DIRECTORY":65536,"O_NOATIME":262144,"O_NOFOLLOW":131072,"O_SYNC":1052672,"O_DSYNC":4096,"O_DIRECT":16384,"O_NONBLOCK":2048,"S_IRWXU":448,"S_IRUSR":256,"S_IWUSR":128,"S_IXUSR":64,"S_IRWXG":56,"S_IRGRP":32,"S_IWGRP":16,"S_IXGRP":8,"S_IRWXO":7,"S_IROTH":4,"S_IWOTH":2,"S_IXOTH":1,"F_OK":0,"R_OK":4,"W_OK":2,"X_OK":1,"UV_FS_COPYFILE_EXCL":1,"COPYFILE_EXCL":1},"F_OK":0,"R_OK":4,"W_OK":2,"X_OK":1},"thenifyFs":{"constants":{"O_RDONLY":0,"O_WRONLY":1,"O_RDWR":2,"S_IFMT":61440,"S_IFREG":32768,"S_IFDIR":16384,"S_IFCHR":8192,"S_IFBLK":24576,"S_IFIFO":4096,"S_IFLNK":40960,"S_IFSOCK":49152,"O_CREAT":64,"O_EXCL":128,"O_NOCTTY":256,"O_TRUNC":512,"O_APPEND":1024,"O_DIRECTORY":65536,"O_NOATIME":262144,"O_NOFOLLOW":131072,"O_SYNC":1052672,"O_DSYNC":4096,"O_DIRECT":16384,"O_NONBLOCK":2048,"S_IRWXU":448,"S_IRUSR":256,"S_IWUSR":128,"S_IXUSR":64,"S_IRWXG":56,"S_IRGRP":32,"S_IWGRP":16,"S_IXGRP":8,"S_IRWXO":7,"S_IROTH":4,"S_IWOTH":2,"S_IXOTH":1,"F_OK":0,"R_OK":4,"W_OK":2,"X_OK":1,"UV_FS_COPYFILE_EXCL":1,"COPYFILE_EXCL":1},"F_OK":0,"R_OK":4,"W_OK":2,"X_OK":1},"rimrafOptions":{"constants":{"O_RDONLY":0,"O_WRONLY":1,"O_RDWR":2,"S_IFMT":61440,"S_IFREG":32768,"S_IFDIR":16384,"S_IFCHR":8192,"S_IFBLK":24576,"S_IFIFO":4096,"S_IFLNK":40960,"S_IFSOCK":49152,"O_CREAT":64,"O_EXCL":128,"O_NOCTTY":256,"O_TRUNC":512,"O_APPEND":1024,"O_DIRECTORY":65536,"O_NOATIME":262144,"O_NOFOLLOW":131072,"O_SYNC":1052672,"O_DSYNC":4096,"O_DIRECT":16384,"O_NONBLOCK":2048,"S_IRWXU":448,"S_IRUSR":256,"S_IWUSR":128,"S_IXUSR":64,"S_IRWXG":56,"S_IRGRP":32,"S_IWGRP":16,"S_IXGRP":8,"S_IRWXO":7,"S_IROTH":4,"S_IWOTH":2,"S_IXOTH":1,"F_OK":0,"R_OK":4,"W_OK":2,"X_OK":1,"UV_FS_COPYFILE_EXCL":1,"COPYFILE_EXCL":1},"F_OK":0,"R_OK":4,"W_OK":2,"X_OK":1,"disableGlob":true},"storePath":"/home/composer/.composer/cards"}, {}, [object Object]
ConnectorServer :constructor() <
I am running on:
Ubuntu 16.04 LTS
Docker version 17.12.1-ce, build 7390fc6
Any ideas?
Same problem :/ First time it worked fine but next time, an engine of undefined. any solution?
EDIT:
I manage to make it works again, just run composer-playground with sudo privileges. That solves my problem. Hope it helps!

Docker not working on Windows 10

I have Windows 8.1 in my laptop
I installed Oracle VM and put Windows 10 Anniversary Update
I have installed docker and enabled Hyper-V
But the Docker service does not work and throws this error:
[12:44:35.012][DataKit ][Info ] Failed to set up server socket listening on "hyperv-connect://bc82778c-022a-45cc-8e60-eedbc6a4eb52": Unix.Unix_error(Unix.ENETDOWN, "socket", "")
[12:44:35.042][DataKit ][Info ] +6272us Datakit Starting com.docker.db.exe 09081b4 ...

Resources