Skip to content
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

zsh-z fails to work if .z is mapped to docker host file #86

Open
fzyzcjy opened this issue Mar 25, 2024 · 2 comments
Open

zsh-z fails to work if .z is mapped to docker host file #86

fzyzcjy opened this issue Mar 25, 2024 · 2 comments

Comments

@fzyzcjy
Copy link

fzyzcjy commented Mar 25, 2024

Hi thanks for the library! I want to use it in docker containers (indeed https://github.com/jupyter/docker-stacks). It works pretty well, until I want to keep the history between container re-creations. To do so, I add a volume mount from my host to the container, e.g. the following docker compose file:

    volumes:
      - /home/tom/my_container_z:/home/jovyan/.z

However, zsh-z fails to work implicitly now. The .z is also always empty.

I guess it may because file locking mechanism etc. Is there any way to workaround it?

@agkozak
Copy link
Owner

agkozak commented Mar 26, 2024

I'll probably want to try out doing exactly what you're doing to see if I can detect what's going wrong. If you give me a couple of days, I should have time.

@fzyzcjy
Copy link
Author

fzyzcjy commented Mar 26, 2024

Thank you very much and take your time!

More detailed reproduction steps:

Here is my Dockerfile (omitting unrelated parts):

# Or use jupyter's docker-stacks directly; This one just adds more python packages and gpu support etc
FROM cschranz/gpu-jupyter:v1.6_cuda-12.0_ubuntu-22.04

# ... other commands omitted ...

USER root
RUN set -eux ; \
    chsh -s $(which zsh) ; \
    sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
USER ${NB_UID}

RUN set -eux ; sed -i 's/plugins=(git)/plugins=(git z)/g' /home/jovyan/.zshrc

docker-compose.yaml:

version: "3"

services:
  jupyter:
    build: ./jupyter
    ports:
      - '8888:8888'
    command: 'start-notebook.py --ServerApp.root_dir=/host_home'
    environment:
      SHELL: /bin/zsh
    volumes:
      - /home/tom/Main/Others/primary_docker/.zsh_history:/home/jovyan/.zsh_history
      - /home/tom/Main/Others/primary_docker/.z:/home/jovyan/.z
    # ... unrelated things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants