我有一个简单的Dockerfile,如下所示:
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get -y upgrade
RUN mkdir -p /root/.ssh
RUN touch /root/.ssh/known_hosts
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
运行结果:
docker build -no-cache -t testimage .
是:
Step 5 : RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
---> Running in e11ef5962a11
/bin/sh: 1: ssh-keyscan: not found