Skip to content

Commit 029b044

Browse files
committed
update dockerfile
1 parent a59734a commit 029b044

2 files changed

Lines changed: 16 additions & 18 deletions

File tree

Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
FROM ubuntu:18.04
2-
RUN apt-get update && apt-get install wget -y
3-
RUN wget https://github.com/ucloud/ucloud-cli/releases/download/0.1.22/ucloud-cli-linux-0.1.22-amd64.tgz
4-
RUN tar -zxf ucloud-cli-linux-0.1.22-amd64.tgz -C /usr/local/bin/
5-
RUN echo "complete -C $(which ucloud) ucloud" >> ~/.bashrc
1+
FROM golang:latest
2+
3+
WORKDIR /root
4+
5+
RUN apt update \
6+
&& apt install zsh vim -y \
7+
&& wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh \
8+
&& sh install.sh
9+
10+
RUN git clone https://github.com/ucloud/ucloud-cli.git \
11+
&& cd ucloud-cli && make install && cd ../ \
12+
&& echo "autoload -U +X bashcompinit && bashcompinit \ncomplete -F $(which ucloud) ucloud" >> ~/.zshrc

README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,29 +80,20 @@ Vist the [releases page](https://github.com/ucloud/ucloud-cli/releases) of uclou
8080
Download the archive , and extract it. Add binary file ucloud.exe to your environment variable PATH following [this document](https://www.java.com/en/download/help/path.xml)
8181

8282
## Using ucloud cli in a Docker container
83-
If you have installed docker on your platform, pull the docker image embeded ucloud cli by follow command.
83+
If you have installed docker on your platform, pull the docker image embeded ucloud cli by follow command. Lookup Dockerfile from [here](./Dockerfile)
8484
```
85-
docker pull uhub.service.ucloud.cn/ucloudcli/ucloud-cli:0.1.22
86-
```
87-
88-
The docker image was built by the Dockerfile as follow.
89-
```
90-
FROM ubuntu:18.04
91-
RUN apt-get update && apt-get install wget -y
92-
RUN wget https://github.com/ucloud/ucloud-cli/releases/download/0.1.22/ucloud-cli-linux-0.1.22-amd64.tgz
93-
RUN tar -zxf ucloud-cli-linux-0.1.22-amd64.tgz -C /usr/local/bin/
94-
RUN echo "complete -C $(which ucloud) ucloud" >> ~/.bashrc #enable auto completion
85+
docker pull uhub.service.ucloud.cn/ucloudcli/ucloud-cli:source-code
9586
```
9687

9788
Create a docker container named ucloud-cli using the docker image your have pulled by following command.
9889

9990
```
100-
docker run --name ucloud-cli -it -d uhub.service.ucloud.cn/ucloudcli/ucloud-cli:0.1.22
91+
docker run --name ucloud-cli -it -d uhub.service.ucloud.cn/ucloudcli/ucloud-cli:source-code
10192
```
10293
Run bash command in ucloud-cli container, and then you could play with ucloud cli.
10394

10495
```
105-
docker exec -it ucloud-cli bash
96+
docker exec -it ucloud-cli zsh
10697
```
10798

10899
## Enabling Shell Auto-Completion for bash or zsh shell user.

0 commit comments

Comments
 (0)