-
Notifications
You must be signed in to change notification settings - Fork 38
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
Import login.json automatically in docker compose #89
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,58 @@ | ||
version: '3.9.1' | ||
version: "3.9.1" | ||
|
||
# You must manually run `ankerctl config import` atleast once | ||
# docker run \ | ||
# -v ankerctl_vol:/root/.config/ankerctl \ | ||
# -v "$HOME/Library/Application Support/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" \ | ||
# ankerctl config import /tmp/login.json | ||
services: | ||
ankerctl: | ||
image: ankerctl/ankerctl:latest | ||
container_name: ankerctl | ||
restart: unless-stopped | ||
build: . | ||
environment: | ||
- FLASK_PORT=4470 | ||
- FLASK_HOST=0.0.0.0 | ||
volumes: | ||
- ankerctl_vol:/root/.config/ankerctl | ||
ports: | ||
- 127.0.0.1:4470:4470 | ||
entrypoint: "/app/ankerctl.py" | ||
command: ["webserver", "run"] | ||
ankerctl_seed_mac: | ||
image: busybox | ||
container_name: ankerctl_seed_mac | ||
restart: "no" | ||
volumes: | ||
- ankerctl_vol:/root/.config/ankerctl | ||
- "$HOME/Library/Application Support/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" | ||
command: sh -c "cp /tmp/login.json /root/.config/ankerctl/login.json || true" | ||
ankerctl_seed_linux: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no version of AnkerMake for Linux just yet, and if there is in the future the path will look more like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. INFORMATIONAL: Not for v1.0.0 ship but for v.1.1 we can look at their alpha build of the new slicer since that does have a linux build. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok after futzing with this for about an hour I have it working this way:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 Hmm, that is interesting. If the command argument is commented out then the I suspect what happened is another previous attempt copied the login.json to the volume. If you purge your docker volumes, and then try again I'm fairly confident that this will not work with that line commented out.
|
||
image: busybox | ||
container_name: ankerctl_seed_linux | ||
restart: "no" | ||
volumes: | ||
- ankerctl_vol:/root/.config/ankerctl | ||
# TODO: verify this is the correct linux path | ||
- "$HOME/AnkerMake/AnkerMake_64bit_fp/login.json:/tmp/login.json" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would be our best bet, for Linux users running ankermake through wine with default settings: $HOME/.wine/drive_c/users/$USER/AppData/Local/AnkerMake/AnkerMake_64bit_fp/login.json |
||
command: sh -c "cp /tmp/login.json /root/.config/ankerctl/login.json || true" | ||
ankerctl_import: | ||
# image: ghcr.io/ankermgmt/ankermake-m5-protocol:latest | ||
image: ankerctl/ankerctl:latest | ||
container_name: ankerctl_import | ||
restart: "no" | ||
build: . | ||
volumes: | ||
- ankerctl_vol:/root/.config/ankerctl | ||
entrypoint: "/app/ankerctl.py" | ||
command: ["config", "import", "/root/.config/ankerctl/login.json"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't it be simpler to put In fact, this location clashes with an upcoming feature, where it will be possible to select other "profiles" than Also, can't we stack I realize now that |
||
depends_on: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this just a naming thing though? It's called ankerctl_import and is still importing the login.json file right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, lets scrap linux support, and add windows support. Do you know the path on windows? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The way I understand it, the @spuder could we make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @spuder See above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tried a few local edits and can't find a way of getting thsi to work for Windows using Docker Desktop on WSL. |
||
- ankerctl_seed_mac | ||
- ankerctl_seed_linux | ||
|
||
ankerctl: | ||
# image: ghcr.io/ankermgmt/ankermake-m5-protocol:latest | ||
image: ankerctl/ankerctl:latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain how Suppose we make sure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eventually We can switch ankerctl/ankerctl to ghcr once we have the updated web gui published. |
||
container_name: ankerctl | ||
restart: unless-stopped | ||
build: . | ||
environment: | ||
- FLASK_PORT=4470 | ||
- FLASK_HOST=0.0.0.0 | ||
volumes: | ||
- ankerctl_vol:/root/.config/ankerctl | ||
ports: | ||
- 127.0.0.1:4470:4470 | ||
working_dir: /app | ||
entrypoint: "/app/ankerctl.py" | ||
command: ["webserver", "run"] | ||
depends_on: | ||
- ankerctl_seed_mac | ||
- ankerctl_seed_linux | ||
- ankerctl_import | ||
|
||
volumes: | ||
ankerctl_vol: | ||
external: true | ||
external: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail on mac because of the space, you need to properly escape the space between
Application
andSupport
.