English 中文(简体)
如何在杜克集装箱内安卡拉安装土机
原标题:How to install homebrew on Ubuntu inside Docker container

When I try to install homebrew on Ubuntu 18.04

# Dockerfile
FROM ubuntu:18.04

RUN apt-get update && apt-get install build-essential curl file git -y
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

出现错误:

==> Add Ruby to your PATH by running: PATH=/root/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/current/bin:$PATH Don t run this as root!

最佳回答
问题回答

新的正确方式是:

RUN apt-get update && 
    apt-get install -y -q --allow-unauthenticated 
    git 
    sudo
RUN useradd -m -s /bin/zsh linuxbrew && 
    usermod -aG sudo linuxbrew &&  
    mkdir -p /home/linuxbrew/.linuxbrew && 
    chown -R linuxbrew: /home/linuxbrew/.linuxbrew
USER linuxbrew
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

加布里埃尔的回答大多为我工作,但缺少一个步骤。 页: 1 • 安装自制器的用户:

RUN apt-get update && 
    apt-get install -y -q --allow-unauthenticated 
    git 
    sudo
RUN useradd -m -s /bin/zsh linuxbrew && 
    usermod -aG sudo linuxbrew &&  
    mkdir -p /home/linuxbrew/.linuxbrew && 
    chown -R linuxbrew: /home/linuxbrew/.linuxbrew
USER linuxbrew
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

USER root
RUN chown -R $CONTAINER_USER: /home/linuxbrew/.linuxbrew

上述答复没有在乌班图22.04 Docker集装箱为我工作。

I had to add couple of steps Here s the full code:

RUN apt-get update && 
    apt-get install -y -q --allow-unauthenticated 
    git 
    sudo
RUN useradd -m -s /bin/zsh linuxbrew && 
    usermod -aG sudo linuxbrew &&  
    mkdir -p /home/linuxbrew/.linuxbrew && 
    chown -R linuxbrew: /home/linuxbrew/.linuxbrew
USER linuxbrew
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
USER root
RUN chown -R $CONTAINER_USER: /home/linuxbrew/.linuxbrew
ENV PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}"
RUN git config --global --add safe.directory /home/linuxbrew/.linuxbrew/Homebrew
USER linuxbrew
RUN brew update
RUN brew doctor




相关问题
Add a changing icon to Ubuntu Panel

What would be the most simple way of adding and changing an icon in the Ubuntu (Gnome) Panel? I m looking for something as simple as shell scripting, but I m not restricted to that. Will write a ...

Configuring kernel

After create a new system call, how to update the kernel? I tried these lines, make-kpkg clean fakeroot make-kpkg -initrd -append-to-version=-custom kernel_image kernel_headers But Ubuntu asked me ...

save Exceptions to file in python

I want to save all following Exceptions in a file. The reason why I need this is because the IDLE for python 3.1.1 in Ubuntu raises an Exception at calltipps, but close to fast, that it isn t readble. ...

How can i monitor system statistics in kubuntu using Java?

i am doing a project related to configuration and memory analyzer for kubuntu. i want to display the system statistics information like CPU usage, RAM usage and proceses etc. graphically using an ...

How to pass "--external-locking" for mysqld in Ubuntu

I would like to start my mysql server with the --external-locking option. As mysqld is run by the /etc/init.d/mysql script ubuntu (karmic), I guess that s where I should set this "--external-locking" ...

"g++" and "c++" compiler

I just found on my Ubuntu, there are two different C++ compilers: /usr/bin/g++ and /usr/bin/c++. I am not familiar with the latter, but man c++ just jumps to the manpage of gcc. I wonder what is their ...

热门标签