From d81526190070630a933bcd06229fada8074962fa Mon Sep 17 00:00:00 2001 From: Nao1215 Date: Mon, 29 Nov 2021 22:50:54 +0900 Subject: [PATCH] Fix ShellSpec install process. Because ShellSpec could not be installed using the installer in the Docker environment, I changed to the installation method using git clone and Makefile. --- Dockerfile | 18 ++++++++---------- README.md | 6 +++--- scripts/installShellSpec.sh | 12 ------------ scripts/installShellSpecForDocker.sh | 5 +++++ 4 files changed, 16 insertions(+), 25 deletions(-) delete mode 100755 scripts/installShellSpec.sh create mode 100755 scripts/installShellSpecForDocker.sh diff --git a/Dockerfile b/Dockerfile index 266f16f..0acbc56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,22 +2,20 @@ FROM golang as builder ENV ROOT=/go/app WORKDIR ${ROOT} -# 1) Install package for setup -# 2) Install mimixbox -# 3) Create mimixbox symbolic link in container. -# 4) Setting root user password -# 5) Add mimixbox user -# 6) Setting mimixbox user password -RUN apt-get update && apt-get install -y expect && \ - go install github.com/nao1215/mimixbox/cmd/mimixbox@latest && \ +# 1) Install mimixbox +# 2) Create mimixbox symbolic link in container. +# 3) Setting root user password +# 4) Add mimixbox user +# 5) Setting mimixbox user password +RUN go install github.com/nao1215/mimixbox/cmd/mimixbox@latest && \ mimixbox --full-install /usr/local/bin/ RUN echo 'root:password' | chpasswd RUN useradd mimixbox -m -s /bin/bash &&\ echo 'mimixbox:password' |chpasswd # Copy ShellSpec installer -COPY ./scripts/installShellSpec.sh /home/mimixbox -RUN /home/mimixbox/installShellSpec.sh && rm /home/mimixbox/install*.sh +COPY ./scripts/installShellSpecForDocker.sh . +RUN ./installShellSpecForDocker.sh # If you want to administrator privileges, you become the root user. # RUN echo "mimixbox ALL=(ALL) ALL" >> /etc/sudoers diff --git a/README.md b/README.md index c5f8f27..d784d13 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The table below shows the tools used when developing the commands in the mimixbo | pandoc | Convert markdown files to manpages | | make | Used for build, run, test, etc | | gzip | Used for compress man pages | -| expect | Used for install ShellSpec in Docker| +| curl | Used for install ShellSpec | | install | Used for install serial binary and document in the system | | docker| Used for testing Mimixbox inside Docker| | debootstrap| Used for testing Mimixbox inside jail envrioment| @@ -34,9 +34,9 @@ The table below shows the tools used when developing the commands in the mimixbo If you use Debian-based distribution (e.g. Debian/Ubuntu/Kali Linux/Raspberry Pi OS), You can install tools with the following command. ``` -$ sudo apt install build-essential wget expect git pandoc gzip expect docker.io debootstrap +$ sudo apt install build-essential curl git pandoc gzip docker.io debootstrap $ go install github.com/google/go-licenses@latest -$ curl -fsSL https://git.io/shellspec | sh +$ curl -fsSL https://git.io/shellspec | sh -s -- --yes ``` ### How to build diff --git a/scripts/installShellSpec.sh b/scripts/installShellSpec.sh deleted file mode 100755 index 3049168..0000000 --- a/scripts/installShellSpec.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -eu - -curl -fsSL https://git.io/shellspec > install.sh -chmod a+x install.sh - -expect -c " - set timeout 3 - spawn ./install.sh - expect \"\[y\/N\]\" - send \"y\n\" - interact -" \ No newline at end of file diff --git a/scripts/installShellSpecForDocker.sh b/scripts/installShellSpecForDocker.sh new file mode 100755 index 0000000..08569d3 --- /dev/null +++ b/scripts/installShellSpecForDocker.sh @@ -0,0 +1,5 @@ +#!/bin/bash -eu + +git clone https://github.com/shellspec/shellspec.git +cd shellspec +make install \ No newline at end of file