我是Mac用户,无法在Mac上安装gluu,因此我尝试在Dockerfile中的ubuntu上安装它:
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get upgrade
RUN apt-get install -y \
curl \
openssl \
ca-certificates
RUN echo "deb https://repo.gluu.org/ubuntu/ bionic main" > /etc/apt/sources.list.d/gluu-repo.list
RUN curl https://repo.gluu.org/ubuntu/gluu-apt.key | apt-key add -
RUN apt-get install gluu-server
但我在终端中收到此错误:
E: Unable to locate package gluu-server
The command '/bin/sh -c apt-get install gluu-server' returned a non-zero code: 100
有人可以帮助我吗?
答案 0 :(得分:2)
这应该有效
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install \
curl \
openssl \
ca-certificates \
apt-transport-https -y
RUN echo "deb https://repo.gluu.org/ubuntu/ bionic main" > /etc/apt/sources.list.d/gluu-repo.list
RUN curl https://repo.gluu.org/ubuntu/gluu-apt.key | apt-key add -
RUN apt-get update
RUN apt-get install gluu-server -y
答案 1 :(得分:1)
如果行不起作用,只需将运行apt-get install gluu-server 行更改为运行apt-get install gluu-server-3.1.0 除了在 RUN curl https://repo.gluu.org/ubuntu/gluu-apt.key |后添加此 RUN apt-get install apt-transport-https |, apt键添加-。
创建此docker镜像的方式也不是很理想,创建的图层太多,不建议这样做,在生产环境中不要这样做