ubuntu 16.04 的 docker 镜像中缺少 cron 和 crontab

Ant*_*ong 5 cron docker

这是我的 Dockerfile

FROM ubuntu:16.04
RUN apt-get update -y && apt-get install -y \
  git \
  python \
  python-pip
Run Code Online (Sandbox Code Playgroud)

创建 docker 映像后,我登录并尝试设置用于测试的 cron 作业。令我惊讶的是,croncrontab没有出现。

# ls 
app  bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  
root  run  sbin  srv  sys  tmp  usr  var
# crontab -l
/bin/sh: 6: crontab: not found
# crontab -l
/bin/sh: 7: crontab: not found
# crontab -l
/bin/sh: 10: crontab: not found
# cron
/bin/sh: 11: cron: not found
Run Code Online (Sandbox Code Playgroud)

但我希望cron出现在 ubuntu 图像中。我是否选择了错误的图像,或者我需要做些什么来启用cron

Ant*_*ong 8

镜像ubuntu:16.04默认没有安装cron命令

需要运行 apt-get install cron