Skip to content

Commit

Permalink
Removed docker-machine option.
Browse files Browse the repository at this point in the history
  • Loading branch information
bilke committed Mar 22, 2019
1 parent 62bf060 commit 421c3e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
31 changes: 7 additions & 24 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,27 +192,10 @@
if args.upload:
run(f"docker push {tag}", shell=True)
if args.convert:
if 'DOCKER_MACHINE_NAME' in os.environ:
run("mkdir -p tmp", shell=True)
run(f"docker-machine mount singularity1:/home/bilke/tmp tmp",
shell=True)
run(f"docker run -v /var/run/docker.sock:/var/run/docker.sock "
f"-v /home/bilke/tmp:/output --privileged -t --rm "
f"singularityware/docker2singularity --name {img_file} {tag}",
shell=True)
run(f"mv tmp/*.sif $PWD/{images_out_dir}/", shell=True)
if platform.system() == 'Darwin':
run(f"umount tmp", shell=True)
else:
run(
f"docker-machine mount -u singularity1:/home/bilke/tmp tmp",
shell=True)
run("rm -rf tmp", shell=True)
else:
run(f"docker run -d -p 5000:5000 --rm --name registry registry:2 && "
f"docker tag {tag} localhost:5000/{tag} && "
f"docker push localhost:5000/{tag} && "
f"SINGULARITY_NOHTTPS=true singularity build --force {images_out_dir}/{img_file} docker://localhost:5000/{tag} && "
f"docker rmi localhost:5000/{tag} && "
f"docker stop registry",
shell=True)
run(f"docker run -d -p 5000:5000 --rm --name registry registry:2 && "
f"docker tag {tag} localhost:5000/{tag} && "
f"docker push localhost:5000/{tag} && "
f"SINGULARITY_NOHTTPS=true singularity build --force {images_out_dir}/{img_file} docker://localhost:5000/{tag} && "
f"docker rmi localhost:5000/{tag} && "
f"docker stop registry",
shell=True)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
six
hpccm
requests

0 comments on commit 421c3e9

Please sign in to comment.