Ubuntu docker : unable to locate the package

I want to install OpenJDK-8-JDK on ubuntu docker but it failed

bzy@bzy-Lenovo-IdeaPad-Y500:~/bittigercs503-1705/week4/executor$ sudo docker build . -t zhiweibao

Sending build context to Docker daemon 4.608kB

Step 1/4 : FROM ubuntu:16.0 —> 2a4cca5ac898

Step 2/4 : MAINTAINER zhiweibao —> Using cache —> a3d102eca4aa

Step 3/4 : RUN apt-get update —> Using cache —> c681c5418af9

Step 4/4 : RUN apt-get install -y openjdk-8-jdk —> Running in 0703163e10ac

Reading package lists… Building dependency tree… Reading state information…

E: Unable to locate package openjdk-8-jdk The command ‘/bin/sh -c apt-get install -y openjdk-8-jdk’ returned a non-zero code: 100


FROM ubuntu:16.04

MAINTAINER zhiweibao

RUN apt-get update

RUN apt-get install -y openjdk-8-jdk

u need to add the repo before apt=get update

see https://docs.datastax.com/en/cassandra/3.0/cassandra/install/installOpenJdkDeb.html