Makefile 935 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. -include .env
  2. NAME ?= ipfsnode:latest
  3. ID ?= ipfstest
  4. LOCAL_DIR ?= /tmp/ipfsdata
  5. LOCAL_STAGING_DIR ?= /tmp/staging
  6. default: init build run
  7. init:
  8. bash init_container
  9. build:
  10. docker build $(BUILD_OPTIONS) -t $(NAME) .
  11. shell:
  12. docker exec -it $(ID) /bin/bash
  13. run:
  14. mkdir -p $(LOCAL_DIR) $(LOCAL_STAGING_DIR)
  15. docker run --name $(ID) -v $(LOCAL_STAGING_DIR):/staging -v $(LOCAL_DIR):/home/ipfs/.ipfs $(NAME)
  16. start:
  17. docker start -ia $(ID)
  18. daemon:
  19. docker start $(ID)
  20. stop:
  21. docker stop $(ID)
  22. rm: stop
  23. docker rm $(ID)
  24. ps:
  25. docker ps -a
  26. public:
  27. bash add_public_route $(ID) $(PUBLIC_IP) $(PUBLIC_IFACE)
  28. docker exec $(ID) ipfs config Addresses.Swarm --json '[ "/ip4/0.0.0.0/tcp/40001" ]'
  29. docker restart $(ID)
  30. private:
  31. bash remove_public_route $(ID) $(PUBLIC_IP) $(PUBLIC_IFACE)
  32. docker exec $(ID) ipfs config Addresses.Swarm --json '[ "/ip4/127.0.0.1/tcp/40001" ]'
  33. docker restart $(ID)
  34. genswarmkey:
  35. bash generate_swarm_key