Skip to content

Instantly share code, notes, and snippets.

@JuPlutonic
Created May 17, 2021 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JuPlutonic/004879c3521a8cb246d9dcff5addedea to your computer and use it in GitHub Desktop.
Save JuPlutonic/004879c3521a8cb246d9dcff5addedea to your computer and use it in GitHub Desktop.
1st run `docker pull elementary/docker` for eOS image. 2nd run `docker build .` Last `docker run -it --rm -P hash_of_built_image /bin/zsh`
FROM elementary/docker:stable
LABEL maintainer="#gh#juplutonic"
LABEL name="Linuxbrew/hera"
ARG USER_NAME="dockerhera"
ARG USER_PASSWORD="Docker4Hera"
RUN apt-get update \
&& apt-get install -y curl file g++ git locales make uuid-runtime patch gperf zsh \
build-essential libssl-dev zlib1g-dev libbz2-dev libsqlite3-dev wget llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
&& apt-get clean
RUN localedef -i en_US -f UTF-8 en_US.UTF-8 \
&& useradd -m -s /bin/zsh linuxbrew \
&& echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers
# update the password
RUN adduser --quiet --disabled-password --shell /bin/zsh --home /home/$USER_NAME --gecos "User" $USER_NAME \
&& echo "${USER_NAME}:${USER_PASSWORD}" | chpasswd && usermod -aG sudo $USER_NAME
USER linuxbrew
WORKDIR /home/linuxbrew
# key `--depth` not needed unless you on a low brandwidth / mobile operator
RUN git clone --depth=1 https://github.com/Homebrew/brew .linuxbrew
ENV PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH \
SHELL=/bin/bash
# the line bellow `git clone ...=origin` not needed at all unless you on a low brandwidth:
RUN git clone --depth=1 https://github.com/Homebrew/linuxbrew-core /home/linuxbrew/.linuxbrew/Library/Taps/homebrew/homebrew-core --origin=origin
RUN brew install python anyenv
USER $USER_NAME
ENV ANYENV_ROOT=/home/${USER_NAME}/.anyenv \
ANYENV_PLUGINS=/home/${USER_NAME}/.anyenv/plugins \
PATH=$ANYENV_ROOT/bin:/home/${USER_NAME}/.anyenv/envs/pyenv/bin:/home/${USER_NAME}/.anyenv/envs/pyenv/shims:$PATH \
SHELL=/usr/bin/zsh \
PYENV_ROOT=/home/${USER_NAME}/.anyenv/envs/pyenv
RUN printf 'eval "$(anyenv init -)"\n' > /home/${USER_NAME}/.zshrc \
&& exec $SHELL -l
RUN anyenv install --force-init \
&& mkdir -p $ANYENV_PLUGINS
RUN anyenv install --list
RUN anyenv install --skip-existing pyenv
RUN pyenv install 3.9.5
CMD ["zsh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment