惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
G
Google Developers Blog
小众软件
小众软件
V
V2EX
月光博客
月光博客
腾讯CDC
aimingoo的专栏
aimingoo的专栏
J
Java Code Geeks
Y
Y Combinator Blog
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 【当耐特】
D
Docker
M
MIT News - Artificial intelligence
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
MongoDB | Blog
MongoDB | Blog
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN
How to Install zplug inside Docker Container
2019-10-01 · via jdhao's digital space

In the past few days, I tried to dockerize my development environment and put my daily programming tools inside container. I tried to install zplug inside docker container and met some issues. In this post, I want to share how to install zplug and other plugins inside the Docker container.

Following the recommended way in the zplug git repo, I use the instruction below to install zplug:

RUN curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh

Unfortunately, the build fails and gives the following error message:

The command ‘/bin/sh -c curl -sL –proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh’ returned a non-zero code: 1

After some searching, I find that this issue is caused by the Unicode characters that zplug uses in its message. In order to deal with this, we need to set up a locale in UTF-8 format (see here for details):

RUN apt-get install -y locales && locale-gen en_US.UTF-8
ENV LC_ALL en_US.UTF-8

Another issue is that I get an error when I use the following instruction to install plugins:

The error message is that:

The command zplug install works in a normal terminal, but fails to work when we are building a docker image. I change the instruction to

RUN ["zsh", "-ic", "zplug install"]

based on discussions here and I can run the command without errors.

Unfortunately, another error occurs when zplug tries to install plugins. The errors look like this:

✘  Unknown error         lukechilds/zsh-nvm
✘  Unknown error         zsh-users/zsh-completions
✘  Unknown error         junegunn/fzf-bin

According to discussions here, it is caused by the missing package gawk. We need to install the gawk package before running the zplug install command:

RUN apt-get install gawk
RUN ["zsh", "-ic", "zplug install"]

After solving all these issues, I can install zplug and other plugins successfully inside the docker container.