nix-docker
nix-docker copied to clipboard
Can't run nix-docker in current vagrant
sudo -E nix-docker -b -t my-image samples/wordpress.nix
Building Nix closure for the image...
Traceback (most recent call last):
File "/home/vagrant/nix-docker/nix-docker/bin/nix-docker", line 79, in <module>
package_nix_path = build()
File "/home/vagrant/nix-docker/nix-docker/bin/nix-docker", line 40, in build
nix_path = subprocess.check_output(cmd)
File "/usr/lib/python2.7/subprocess.py", line 568, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1308, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Running the command without sudo complains that it must be run with sudo -E.
Not sure where to go from here.
Ubuntu Raring is EOL, and should switch to Trusty.
diff --git a/Vagrantfile b/Vagrantfile
index 573dc15..85e52fe 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -1,6 +1,6 @@
Vagrant.configure("2") do |config|
- config.vm.box = "raring_64"
- config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-amd64-vagrant-disk1.box"
+ config.vm.box = "trusty_64"
+ config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.provider :virtualbox do |vb|
And the sudo -E needs to have the full path to nix-docker as its not in root's path in default vagrant installation.
vagrant@vagrant-ubuntu-trusty-64:~/nix-docker/samples$ sudo -E /home/vagrant/nix-docker/nix-docker/bin/nix-docker -b -t my-image apache-config.nix