Dockerfile for C project
Combine as many RUN statements as possible to reduce the number of layers (and size of the image). Each RUN command makes a new layer.

For example,

RUN apt-get update &amp;&amp; apt-get install --yes software-properties-common git gcc-snapshot


After these, you should clean the cache with apt-get autoremove &amp;&amp; apt-get autoclean. 

For example, 

RUN apt-get update &amp;&amp; apt-get install --yes software-properties-common git gcc-snapshot &amp;&amp; apt-get autoremove &amp;&amp; apt-get autoclean


This saves space on the image.

FROM ubuntu:latest is not best practice. Sometimes something works with FROM ubuntu:16.04, but not FROM ubuntu:18.04 (for example, software compatibility).