Skip to content
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

Cannot execute docker exec command on WSL2 using open3 #23

Open
JackVanier opened this issue Sep 5, 2024 · 0 comments
Open

Cannot execute docker exec command on WSL2 using open3 #23

JackVanier opened this issue Sep 5, 2024 · 0 comments

Comments

@JackVanier
Copy link

Im having issues running a docker exec command on WSL2 using open3. To reproduce I wrote this simple script:

require 'open3'

command = "docker exec -i <CONTAINER_NAME> ls /"
puts "Running #{command}"

stdout, stderr, status = Open3.capture3(command)

puts "STDOUT: #{stdout}"
puts "STDERR: #{stderr}"
puts "STATUS: #{status.exitstatus}"

Running in WSL2 this results in output:

STDOUT:
STDERR:
STATUS: 0

If I run this script in git bash instead I get output:

Running docker exec -i service-build-instance ls /
STDOUT: bin
boot
build
dev
etc
home
lib
lib64
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
STDERR:
STATUS: 0

Anyone who may know what is going on here?

@JackVanier JackVanier changed the title Cannot execute docker exec command on WSL2 Cannot execute docker exec command on WSL2 using open3 Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant