mirror of
https://github.com/arnaucube/configs.git
synced 2026-02-10 04:26:41 +01:00
Add go dockerfile for launch-container script
This commit is contained in:
@@ -47,8 +47,8 @@ source .bashrc
|
|||||||
|
|
||||||
# go
|
# go
|
||||||
echo "installing go 1.14.2"
|
echo "installing go 1.14.2"
|
||||||
wget https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz
|
wget https://golang.org/dl/go1.16.4.linux-amd64.tar.gz
|
||||||
tar -C /usr/local -xzf go1.14.2.linux-amd64.tar.gz
|
tar -C /usr/local -xzf go1.16.4.linux-amd64.tar.gz
|
||||||
|
|
||||||
# nodejs
|
# nodejs
|
||||||
echo "installing nodejs v14"
|
echo "installing nodejs v14"
|
||||||
|
|||||||
38
launch-container/Dockerfile.go
Normal file
38
launch-container/Dockerfile.go
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get -y dist-upgrade && \
|
||||||
|
apt-get install -y \
|
||||||
|
apt-utils \
|
||||||
|
build-essential \
|
||||||
|
wget \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
neovim \
|
||||||
|
vim && \
|
||||||
|
apt-get clean
|
||||||
|
|
||||||
|
RUN curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
|
||||||
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
|
RUN curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
||||||
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
|
RUN curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
|
||||||
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
|
|
||||||
|
# install go
|
||||||
|
RUN wget https://golang.org/dl/go1.16.4.linux-amd64.tar.gz && \
|
||||||
|
tar -C /usr/local -xzf go1.16.4.linux-amd64.tar.gz
|
||||||
|
|
||||||
|
RUN echo "export PATH=$PATH:/usr/local/go/bin" >> ./bashrc
|
||||||
|
RUN echo "export GOPATH=$HOME/go" >> ./bashrc
|
||||||
|
|
||||||
|
RUN git clone https://github.com/arnaucube/configs.git && \
|
||||||
|
cp configs/.vimrc ~/ && \
|
||||||
|
cp configs/vimconfigbase.vim ~/ && \
|
||||||
|
mkdir ~/.config && \
|
||||||
|
mkdir ~/.config/nvim && \
|
||||||
|
cp configs/init.vim ~/.config/nvim/
|
||||||
|
|
||||||
|
WORKDIR /root
|
||||||
|
|
||||||
|
ENTRYPOINT /bin/sh
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
# FROM ubuntu:20.04
|
FROM ubuntu:20.04
|
||||||
FROM alpine:3.7
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get -y dist-upgrade && \
|
apt-get -y dist-upgrade && \
|
||||||
|
|||||||
@@ -15,17 +15,18 @@ if [[ $1 == "help" ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
elif [[ $1 == "new" ]]; then
|
elif [[ $1 == "new" ]]; then
|
||||||
# $2: lang, $3: container_name, $4: image_name
|
# $2: lang, $3: container_name, $4: image_name
|
||||||
|
lang=$2
|
||||||
|
|
||||||
if [[ $2 == "rust" ]]; then
|
if [[ $lang == "rust" ]]; then
|
||||||
2="Dockerfile.rust"
|
lang="Dockerfile.rust"
|
||||||
elif [[ $2 == "go" ]]; then
|
elif [[ $lang == "go" ]]; then
|
||||||
2="Dockerfile.go"
|
lang="Dockerfile.go"
|
||||||
else
|
else
|
||||||
echo "available dockerfiles: go, rust"
|
echo "available dockerfiles: go, rust"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo docker build -t $4 -f $2 .
|
sudo docker build -t $4 -f $lang .
|
||||||
sudo docker run -it --entrypoint=/bin/bash --name $3 $4
|
sudo docker run -it --entrypoint=/bin/bash --name $3 $4
|
||||||
exit 0
|
exit 0
|
||||||
elif [[ $1 == "stop" ]]; then
|
elif [[ $1 == "stop" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user