progrium / envy

Lightweight dev environments with a twist
MIT License
321 stars 21 forks source link

[WIP] Fix build of docker image #50

Closed rodrigorm closed 6 years ago

rodrigorm commented 7 years ago

Hi @progrium, I have made some changes to build the image, need to update some things because of my version of docker and the dependencies.

I have just a small problem, but does not found a way to debug, the steps to reproduce is:

Run the image:

$ docker run -d --name envy -v $HOME/workspace/envy:/envy -v /var/run/docker.sock:/var/run/docker.sock -p 8080:80 -p 22:22 -e HOST_ROOT=$HOME/workspace/envy progrium/envy

SSH into istance:

$ ssh rodrigorm@localhost

Run some envy cli command, twice:

root@rodrigorm:/# envy admin ls
rodrigorm
root@rodrigorm:/# envy admin ls
bash: /sbin/envy: No such file or directory

As you can see, the first time the command works, but at second one the binary was gone.

josegonzalez commented 6 years ago

I had a slightly different fix for the build, but definitely can repro your envy "bug":

root@josegonzalez:/# file /sbin/envy 
/sbin/envy: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, with debug_info, not strippe
d
root@josegonzalez:/# envy help
Usage:
  envy [flags]
  envy [command]
Available Commands:
  environ     
  help        Help about any command
  session     
Flags:
  -h, --help   help for envy
Use "envy [command] --help" for more information about a command.
root@josegonzalez:/# file /sbin/envy 
/sbin/envy: cannot open `/sbin/envy' (No such file or directory)ELF 64-bit LSB shared object, x86-64, version 1 (SYS
V), dynamically linked, with debug_info, not stripped

Starting a new session seems to work fine without restarting envy, so my guess is that either entrykit/codep or execd (now sshfront) are somehow reloading the binary with incorrect permissions somehow?

michaelshobbs commented 6 years ago

this branch fails to build for me with the following error

Step 8/11 : RUN go get && CGO_ENABLED=0 go build -a -buildmode exe -installsuffix cgo -o /bin/envy   && ln -s /bin/envy /bin/enter   && ln -s /bin/envy /bin/auth   && ln -s /bin/envy /bin/serve
 ---> Running in 7950541d8421
package math/bits: unrecognized import path "math/bits" (import path does not begin with hostname)
The command '/bin/sh -c go get && CGO_ENABLED=0 go build -a -buildmode exe -installsuffix cgo -o /bin/envy   && ln -s /bin/envy /bin/enter   && ln -s /bin/envy /bin/auth   && ln -s /bin/envy /bin/serve' returned a non-zero code: 1
Makefile:3: recipe for target 'build' failed
make: *** [build] Error 1

however, #51 seems to build just fine and work without the issues mentioned here