how to avoid uploading base image on dockerhub?

Viewed 47

I have built one image whose base is tensorflow/tensorflow image
when i try to push my image to dockerhub, it is showing that it requires more than 1.5GB to upload

563696d99850: Layer already exists  
143e5fff24a3: Layer already exists  
0c1be9bb1e3d: Pushing [====>                                              ]  5.963MB/65.23MB  
b7a1811f2ea8: Pushing [==========================================>        ]  8.522MB/10.13MB  
f871135480f9: Layer already exists  
0ffcfa94cbd7: Pushing [===>                                               ]  6.658MB/83.39MB  
d988b477570e: Layer already exists  
3ac411c5111b: Layer already exists  
fb527dc12c46: Pushed  
cb90a867c0cd: Pushed  
5a670d7dd0c6: Pushed  
6c92ecfa77e9: Pushing [>                                                  ]  **4.286MB/1.757GB**
5b96a3898347: Pushed  
019cc58032ea: Pushing [=====>                                             ]  1.273MB/10.98MB  
0f02bf561d26: Waiting  
63d29dc0e589: Waiting  
28ba7458d04b: Waiting  
838a37a24627: Waiting  
a6ebef4a95c3: Waiting  
b7f7d2967507: Waiting  

is there any way to avoid this?

Dockerfile:

FROM tensorflow/tensorflow

WORKDIR /usr/src/app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install opencv-python-headless

COPY model.py .
COPY model_08015_07680.h5 .
COPY images /usr/src/app/images
COPY labels.txt .
COPY test_run.py .



CMD ["python","./test_run.py"]

i have pulled the image tensorflow/tensorflow

1 Answers

Well, you can avoid the whole uploading thing with automated builds.

Docker Hub can automatically build images from source code in an external code repository service (GitHub and Bitbucket only) and automatically push the built image to your account.

I won't go into details here as Docker docs already have a dedicated page with detailed information on automated builds.

Related