docker file cheat sheet

Version 0.0.1

FROM ubuntu:16.04

RUN apt-get update; apt-get install -y nginx
RUN echo 'hi, i am here' > /var/www/html/index.html

ENV http_proxy=proxy.tianxiaohui.com
ADD latest.tar.gz /var/www/wordpress
COPY somefile /var/some_place/ #compare to ADD, no magic
VOLUME ["/opt/project", "/data"]
WORKDIR
USER user:group
ARG webapp_user=user
ONBUILD
LABEL location="Shanghai" type="ep" //add image metadata
EXPOSE 80

ENTRYPOINT ["/usr/local/bin/my.sh", "-g"] #docker run command will be as argument for this
CMD ["/usr/local/bin/my.sh", "-l"] #only the last one works,and maybe override by docker run
#docker run --entrypoint 可以覆盖ENTRYPOINT, docker run 后边的command可以覆盖 CMD,如果有entrypoint, cmd 做参数

标签: none

添加新评论