Description of problem: 使用sh执行命令时报错,retcode为1,使用bash时命令正常执行 Version-Release number of selected component (if applicable): How reproducible: 在shell执行以下指令 $ docker pull registry.openanolis.cn/openanolis/anolisos:23 $ docker run -d registry.openanolis.cn/openanolis/anolisos:23 tail -f /dev/null $ docker exec -it [docker_id] /bin/sh $ yum install -y hunspell-devel $ hunspell -D Steps to Reproduce: 1. 2. 3. Actual results: retcode: 1 stdout: stderr: SEARCH PATH: .::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/root/.openoffice.org/3/user/wordbook:/root/.openoffice.org2/user/wordbook:/root/.openoffice.org2.0/user/wordbook:/root/Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo AVAILABLE DICTIONARIES (path is not mandatory for -d option): /usr/share/hunspell/en_GB /usr/share/hunspell/en_US Can't open affix or dictionary files for dictionary named "default". Expected results: retcode: 0 Additional info:
安装hunspell包后执行命令hunspell -D
该问题是由于 docker 使用的时候使用的是 sh 而不是 bash 导致的行为不同 容器中部分环境变量的配置是写在 .bashrc 中,因此使用 bash 可以正常加载完整的环境变量,而 sh 则不会加载 .bashrc 因此对于可以使用 /bin/bash 的场景则不建议继续使用 /bin/sh
*** Bug 12347 has been marked as a duplicate of this bug. ***