Better dockerfile names, add Go and Rust
parent
ea05d23b9d
commit
839ba98466
|
@ -5,10 +5,17 @@ set -eu
|
||||||
# Parse options
|
# Parse options
|
||||||
|
|
||||||
nicetohave=true
|
nicetohave=true
|
||||||
|
go=false
|
||||||
|
rust=false
|
||||||
|
|
||||||
while [ $# != 0 ]; do
|
while [ $# != 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
notnicetohave) nicetohave=false;;
|
nonicetohave) nicetohave=false;;
|
||||||
|
nicetohave) nicetohave=true;;
|
||||||
|
nogo) go=false;;
|
||||||
|
go) go=true;;
|
||||||
|
norust) rust=false;;
|
||||||
|
rust) rust=true;;
|
||||||
*) echo "Unknown flag: $1"; exit 1;;
|
*) echo "Unknown flag: $1"; exit 1;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
|
@ -81,6 +88,7 @@ download_dust() {
|
||||||
--output-document /tmp/dust.tar.gz \
|
--output-document /tmp/dust.tar.gz \
|
||||||
https://github.com/bootandy/dust/releases/download/$version/dust-$version-$arch-$system.tar.gz
|
https://github.com/bootandy/dust/releases/download/$version/dust-$version-$arch-$system.tar.gz
|
||||||
tar -x \
|
tar -x \
|
||||||
|
--gunzip \
|
||||||
--file /tmp/dust.tar.gz \
|
--file /tmp/dust.tar.gz \
|
||||||
--to-stdout \
|
--to-stdout \
|
||||||
dust-$version-$arch-$system/dust > $download_bin_path/dust
|
dust-$version-$arch-$system/dust > $download_bin_path/dust
|
||||||
|
@ -89,9 +97,9 @@ download_dust() {
|
||||||
download_kubectl() {
|
download_kubectl() {
|
||||||
version=$(wget --quiet --output-document - https://dl.k8s.io/release/stable.txt)
|
version=$(wget --quiet --output-document - https://dl.k8s.io/release/stable.txt)
|
||||||
arch=amd64
|
arch=amd64
|
||||||
case $ID in
|
case $PLATFORM in
|
||||||
macos) system=darwin;;
|
macos) system=darwin;;
|
||||||
*) system=linux;;
|
linux) system=linux;;
|
||||||
esac
|
esac
|
||||||
wget \
|
wget \
|
||||||
--output-document $download_bin_path/kubectl \
|
--output-document $download_bin_path/kubectl \
|
||||||
|
@ -100,9 +108,9 @@ download_kubectl() {
|
||||||
}
|
}
|
||||||
download_minio_client() {
|
download_minio_client() {
|
||||||
arch=amd64
|
arch=amd64
|
||||||
case $ID in
|
case $PLATFORM in
|
||||||
macos) system=darwin;;
|
macos) system=darwin;;
|
||||||
*) system=linux;;
|
linux) system=linux;;
|
||||||
esac
|
esac
|
||||||
wget \
|
wget \
|
||||||
--output-document $download_bin_path/mc \
|
--output-document $download_bin_path/mc \
|
||||||
|
@ -116,6 +124,27 @@ download_nvim_plug() {
|
||||||
--output-document $HOME/.config/nvim/autoload/plug.vim \
|
--output-document $HOME/.config/nvim/autoload/plug.vim \
|
||||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
}
|
}
|
||||||
|
download_go() {
|
||||||
|
version=1.16.2
|
||||||
|
arch=amd64
|
||||||
|
case $PLATFORM in
|
||||||
|
macos) system=darwin;;
|
||||||
|
linux) system=linux;;
|
||||||
|
esac
|
||||||
|
wget \
|
||||||
|
--output-document /tmp/go.tar.gz \
|
||||||
|
https://golang.org/dl/go$version.$system-$arch.tar.gz
|
||||||
|
sudo tar -x \
|
||||||
|
--gunzip \
|
||||||
|
--directory /usr/local \
|
||||||
|
--file /tmp/go.tar.gz
|
||||||
|
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
|
||||||
|
sudo ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
|
||||||
|
rm /tmp/go.tar.gz
|
||||||
|
}
|
||||||
|
download_rust() {
|
||||||
|
wget --output-document - https://sh.rustup.rs | sh -s -- -y
|
||||||
|
}
|
||||||
|
|
||||||
# Install basics
|
# Install basics
|
||||||
|
|
||||||
|
@ -180,6 +209,18 @@ case $ID in
|
||||||
esac
|
esac
|
||||||
$nicetohave && pip3 install --no-cache-dir --user thefuck
|
$nicetohave && pip3 install --no-cache-dir --user thefuck
|
||||||
|
|
||||||
|
# Install Golang
|
||||||
|
|
||||||
|
case $ID in
|
||||||
|
macos) packages_add go;;
|
||||||
|
alpine) packages_add go;;
|
||||||
|
*) $go && download_go;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Install Rust
|
||||||
|
|
||||||
|
$rust && download_rust
|
||||||
|
|
||||||
# Install dust
|
# Install dust
|
||||||
|
|
||||||
case $ID in
|
case $ID in
|
||||||
|
@ -195,4 +236,9 @@ $nicetohave && download_minio_client
|
||||||
# Install editor plugins
|
# Install editor plugins
|
||||||
|
|
||||||
download_nvim_plug
|
download_nvim_plug
|
||||||
|
nvim +PlugInstall +qa || true
|
||||||
|
|
||||||
|
# Final packages installation
|
||||||
|
|
||||||
|
packages_install
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ RUN chmod go-rwx .gnupg
|
||||||
|
|
||||||
USER ambrose
|
USER ambrose
|
||||||
|
|
||||||
RUN ./.config/yadm/bootstrap notnicetohave
|
RUN ./.config/yadm/bootstrap nonicetohave nogo norust
|
||||||
|
|
||||||
LABEL org.opencontainers.image.title="environment"
|
LABEL org.opencontainers.image.title="environment"
|
||||||
LABEL org.opencontainers.image.url="https://github.com/serverwentdown/env"
|
LABEL org.opencontainers.image.url="https://github.com/serverwentdown/env"
|
|
@ -1,4 +1,4 @@
|
||||||
FROM debian:buster
|
FROM debian:unstable
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y \
|
&& apt-get install -y \
|
|
@ -1,4 +1,4 @@
|
||||||
FROM ubuntu:20.04
|
FROM ubuntu:20.10
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y \
|
&& apt-get install -y \
|
Loading…
Reference in New Issue