【发布时间】:2021-10-15 00:59:09
【问题描述】:
我是 docker 新手,我想用 Ubuntu 20.04 和 bind9 服务安装构建镜像。
下面是我的docker文件代码
FROM ubuntu:20.04
ENV TZ=Asia
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install -y \
apt-utils \
systemctl \
bind9
RUN /usr/sbin/named -g -c /etc/bind/named.conf -u bind
RUN systemctl restart bind9
我收到如下错误
ERROR:systemctl:Unit bind9.service could not be found.
谁能帮助我,安装 Bind9 后,为什么上面的命令会出错?
错误仅与 Docker 一起出现,如果我在 Ubuntu 20.04 的主机环境中运行相同的命令,那么它可以正常工作。
【问题讨论】: