dockerfile Dockerfile

Dockerfile
FROM ppc64le/ubuntu:18.04
MAINTAINER Haitao Yue <hightall@me.com>
RUN apt-get update && apt-get install -y curl build-essential cmake git pkg-config wget libjpeg8-dev \
    autoconf automake libass-dev libfreetype6-dev libsdl2-dev nginx supervisor redis-server mongodb-clients \
	libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libmysqld-dev \
	libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev yasm libx264-dev libmp3lame-dev libopus-dev libvpx-dev mercurial \
    libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libatlas-base-dev gfortran && \
	apt-get autoclean && apt-get clean && apt-get autoremove && rm -rf /var/cache/apt/
ENV FFMPEG_VERSION 3.4.2
ENV THE_PATCH=https://raw.githubusercontent.com/seiko2plus/just4share/master/opencv/issue11034/libswscale-disable-ppc-yuv2rgb.diff
RUN mkdir ~/ffmpeg_sources ~/ffmpeg_build && cd ~/ffmpeg_sources && \
	git clone -b n${FFMPEG_VERSION} --single-branch --depth 1 git://source.ffmpeg.org/ffmpeg.git && \
	cd ffmpeg && \
    curl $THE_PATCH | git apply -v --whitespace=fix --no-index --directory libswscale && \
    PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
    --enable-gpl \
    --prefix="$HOME/ffmpeg_build" \
    --pkg-config-flags="--static" \
    --extra-cflags="-I$HOME/ffmpeg_build/include" \
    --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
    --extra-libs="-lpthread -lm" \
    --bindir="$HOME/bin" \
    --enable-libvpx --enable-libx264 --enable-nonfree \
    --enable-avresample \
    --disable-doc \
    --enable-static \
    --disable-altivec --disable-vsx && \
    PATH="$HOME/bin:$PATH" make -j $(nproc --all) && make install && \
	rm -rf ~/ffmpeg_sources
ENV PATH="$HOME/bin:$PATH"
ENV PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig:$PKG_CONFIG_PATH"
RUN apt-get install -y python3.6-dev python3-pip unzip \
	&& pip3 install numpy
ENV OPENCV_VERSION 3.4.1
RUN mkdir /Opencv-temp && cd /Opencv-temp && \
	git clone -b ${OPENCV_VERSION} --single-branch --depth 1 https://github.com/opencv/opencv.git \
    && wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/${OPENCV_VERSION}.zip \
    && unzip opencv_contrib.zip \
    && cd opencv \
    && mkdir build && cd build \
    && cmake -DWITH_FFMPEG=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local \
    -DBUILD_opencv_dnn=OFF -DBUILD_opencv_features2d=OFF \
    -DBUILD_opencv_calib3d=OFF -DBUILD_opencv_shape=OFF -DBUILD_opencv_ml=OFF \
    -DBUILD_opencv_video=OFF -DBUILD_opencv_flann=OFF \
    -DBUILD_opencv_python2=OFF \
    -DOPENCV_EXTRA_MODULES_PATH=/Opencv-temp/opencv_contrib-${OPENCV_VERSION}/modules .. \
    && make -j $(nproc --all) && make install -j $(nproc --all) \
    && cd /usr/local/lib/python3.6/dist-packages/ && ln -s cv2.cpython-36m-powerpc64le-linux-gnu.so cv2.so && ldconfig \
    && rm -rf /Opencv-temp
ENV PATH=${PATH}:/root/bin
ENV PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/root/ffmpeg_build/lib/pkgconfig

dockerfile Dockerfile vsts-agent

vsts代理:<br/> - Docker.io <br/> - AWS Cli <br/> - Python3 <br/> <br/>运行示例:<br/> docker run --name = vsts-agent \\ \\ <br/> -v /var/run/docker.sock:/var/run/docker.sock \ <br/> -e VSTS_ACCOUNT = account \ <br/> -e VSTS_TOKEN = fg47khaijuwdx4vfeiobrn2aeceofn2zhodwo5dmkecxktk67qwg \ <br/> -e VSTS_AGENT =“$(hostname)-agent”\ <br/> -e VSTS_POOL = agpool \ <br/> -itd vsts-agent

Dockerfile
FROM microsoft/vsts-agent

#Install aws cli
RUN apt-get update; apt-get install python-pip -y
RUN pip install --upgrade pip
RUN pip install setuptools
RUN pip install awscli --upgrade --user

#Install docker
RUN apt-get install docker.io -y

dockerfile 在Kubernetes Pod中安装Google Cloud Storage Bucket

在Kubernetes Pod中安装Google Cloud Storage Bucket

entrypoint.sh
#!/bin/sh
#
# Mount google cloud storage bucket
#
gcsfuse -o nonempty streaming-platform-vod-01 /storage-bucket

#
# If there are anymore arguments passed to the entrypoint,
# invoke the sh shell and pass the value as a command string.
#
/bin/sh -c "$@"
deployment.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: motion
spec:

  selector:
    matchLabels:
      app: motion
  replicas: 1
  template: 
    metadata:
      labels:
        app: motion
    spec:
      imagePullSecrets:
      - name: regcred    
      containers:
      - name: motion
        image: docker.io/appsoa/docker-alpine-motion:3.4
        imagePullPolicy: Always
        command: ["/entrypoint.sh"]
        args: ["run.sh", "/conf/tested.30fps.1pic.conf", "stable.conf"]
        ports:
        - containerPort: 8081
        securityContext:
          privileged: true
          capabilities:
            add: ["SYS_ADMIN"]
        lifecycle:
          postStart:
            exec:
              command: ["gcsfuse", "-o", "nonempty", "streaming-platform-vod-01", "/storage-bucket"]
          preStop:
            exec:
              command: ["fusermount", "-u", "/storage-bucket"]            
        resources:
          limits:
            cpu: 200m
            memory: 300Mi
          requests:
            cpu: 100m
            memory: 300Mi
        volumeMounts:
        - name: gcloud-key
          mountPath: /var/secrets/google
        env:
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: /var/secrets/google/key.json
      volumes:
        - name: gcloud-key
          configMap:
            name: gcloud-key
Dockerfile
#                                 __                 __
#    __  ______  ____ ___  ____ _/ /____  ____  ____/ /
#   / / / / __ \/ __ `__ \/ __ `/ __/ _ \/ __ \/ __  /
#  / /_/ / /_/ / / / / / / /_/ / /_/  __/ /_/ / /_/ /
#  \__, /\____/_/ /_/ /_/\__,_/\__/\___/\____/\__,_/
# /____                     matthewdavis.io, holla!
#
FROM node:9.2-alpine

ENV GOPATH /go
# ENV GOOGLE_APPLICATION_CREDENTIALS=/key.json
ENV GCSFUSE_USER=gcsfuse
ENV GCSFUSE_MOUNTPOINT=/mnt/gcs
ENV GCSFUSE_DEBUG=
ENV GCSFUSE_DEBUG_FUSE=
ENV GCSFUSE_DEBUG_GCS=1
ENV GCSFUSE_DEBUG_HTTP=
ENV GCSFUSE_DEBUG_INVARIANTS=
ENV GCSFUSE_DIR_MODE=
ENV GCSFUSE_FILE_MODE=
ENV GCSFUSE_LIMIT_BPS=
ENV GCSFUSE_LIMIT_OPS=
ENV GCSFUSE_CACHE_STAT_TTL=
ENV GCSFUSE_CACHE_TYPE_TTL=

RUN apk \
    --update \
    --no-cache \
    --virtual build-dependencies \
    add \
    git ffmpeg ffmpeg-dev make autoconf automake gcc g++ libjpeg-turbo-dev go fuse fuse-dev gettext bash


RUN git clone --depth 1 https://github.com/Motion-Project/motion.git && \
    cd motion && \
    autoreconf -fiv && \
    ./configure --prefix /usr/local && \
    make && \
    make install

RUN go get -u github.com/googlecloudplatform/gcsfuse && \
    ln -s /go/bin/gcsfuse /usr/local/bin/gcsfuse && \
    rm -rf /go/pkg/ /go/src/ && \
    gcsfuse --help && \
    mkdir /storage-bucket

COPY key.json /key.json
COPY entrypoint.sh /entrypoint.sh
COPY conf /conf
COPY run.sh /bin/run.sh
COPY platform-api-client-eventemitter /platform-api-client-eventemitter

RUN chmod +x /bin/run.sh

WORKDIR /platform-api-client-eventemitter 

RUN yarn install && \
    yarn run build && \
    bin/client send -h

VOLUME /conf

WORKDIR /
ENTRYPOINT ["run.sh"]
CMD ["/conf/tested.30fps.1pic.conf", "stable.conf"]

dockerfile Dockerfile-的OpenCV

Dockerfile-opencv
FROM ppc64le/ubuntu:16.04
MAINTAINER Haitao Yue <hightall@me.com>
RUN apt-get update && apt-get install -y build-essential cmake git pkg-config wget libjpeg8-dev libjasper-dev \
    autoconf automake libass-dev libfreetype6-dev libsdl2-dev nginx supervisor redis-server mongodb-clients \
	libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libmysqld-dev \
	libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev yasm libx264-dev libmp3lame-dev libopus-dev libvpx-dev mercurial \
    libpng12-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libatlas-base-dev gfortran && \
	apt-get autoclean && apt-get clean && apt-get autoremove && rm -rf /var/cache/apt/
ENV FFMPEG_VERSION 3.3.4
RUN mkdir ~/ffmpeg_sources ~/ffmpeg_build && cd ~/ffmpeg_sources &&  wget http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.bz2 && \
	tar -jxvf nasm-2.13.01.tar.bz2 && cd nasm-2.13.01 && ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && make -j $(nproc --all) && make install && \
	wget -O ~/ffmpeg_sources/fdk-aac.tar.gz https://github.com/mstorsjo/fdk-aac/tarball/master && cd ~/ffmpeg_sources && tar -zxvf fdk-aac.tar.gz && \
	cd mstorsjo-fdk-aac*/ && autoreconf -fiv && ./configure --prefix="$HOME/ffmpeg_build" --disable-shared && make -j $(nproc --all) && make install && \
	cd ~/ffmpeg_sources && hg clone https://bitbucket.org/multicoreware/x265 && \
	cd x265/build/linux && PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source && \
	make -j $(nproc --all) && make install && \
	cd ~/ffmpeg_sources && wget http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && tar -jxvf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
	cd ffmpeg-${FFMPEG_VERSION} && \
    PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
    --prefix="$HOME/ffmpeg_build" \
    --pkg-config-flags="--static" \
    --extra-cflags="-I$HOME/ffmpeg_build/include" \
    --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
    --extra-libs="-lpthread -lm" \
    --bindir="$HOME/bin" \
    --enable-gpl \
    --enable-libass \
    --enable-libfdk-aac \
    --enable-libfreetype \
    --enable-libmp3lame \
    --enable-libopus \
    --enable-libtheora \
    --enable-libvorbis \
    --enable-libvpx \
    --enable-libx264 \
    --enable-libx265 \
    --enable-nonfree && \
    PATH="$HOME/bin:$PATH" make -j $(nproc --all) && make install && \
	rm -rf ~/ffmpeg_sources
ENV PATH="$HOME/bin:$PATH"
ENV PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig:$PKG_CONFIG_PATH"
RUN apt-get install -y python3.5-dev python3-pip unzip \
	&& pip3 install numpy
ENV OPENCV_VERSION 3.3.0
RUN mkdir /Opencv-temp && cd /Opencv-temp && git clone https://github.com/Itseez/opencv.git \
    && wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/${OPENCV_VERSION}.zip \
    && unzip opencv_contrib.zip \
    && cd opencv \
    && git checkout -b ${OPENCV_VERSION} ${OPENCV_VERSION} && mkdir build && cd build \
    && cmake  -D WITH_FFMPEG=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D WITH_V4L=ON -D WITH_LIBV4L=ON -D BUILD_opencv_python2=OFF \
    -D OPENCV_EXTRA_MODULES_PATH=/Opencv-temp/opencv_contrib-${OPENCV_VERSION}/modules \
    -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON .. \
    && make -j $(nproc --all) && make install -j $(nproc --all) \
    && cd /usr/local/lib/python3.5/dist-packages/ && ln -s cv2.cpython-35m-powerpc64le-linux-gnu.so cv2.so && ldconfig \
    && rm -rf /Opencv-temp
ENV PATH=${PATH}:/root/bin
ENV PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/root/ffmpeg_build/lib/pkgconfig

dockerfile Docker Jmeter Base

JMeter的基

Dockerfile
# Base de OpenJDK
FROM openjdk:8-jre-slim

# Argumentos de la Compilacion
ARG JMETER_VERSION=3.3

# Dependencias y Usuario
RUN apt-get -y update \
    && apt-get install -y --no-install-recommends telnet iputils-ping htop \
    && rm -rf /var/lib/apt/lists/* \
    && mkdir /performance

# Espacio de trabajo
WORKDIR /performance

# Jmeter
COPY apache-jmeter-${JMETER_VERSION}.tgz .

# Permisos y Espacio de Trabajo
RUN tar -zxvf apache-jmeter-${JMETER_VERSION}.tgz \
    && rm -f apache-jmeter-${JMETER_VERSION}.tgz \
    && mv apache-jmeter-${JMETER_VERSION} apache-jmeter

# Variable de Entorno
ENV JMETER_HOME /performance/apache-jmeter

# Direcotio de Trabajo
WORKDIR ${JMETER_HOME}

# Librerias
COPY lib.tgz .

# Agregando librerias
RUN tar -zxvf lib.tgz \
    && rm -f lib.tgz \
    && rm -f *.DS_Store

# Variable de Entorno
ENV PATH ${JMETER_HOME}/bin:${PATH}

# Metadatos
LABEL author="joabgonzalez" jmeter="base" jmeter_version=${JMETER_VERSION} target="latest"

dockerfile Docker Jmeter Master

JMeter的主

Dockerfile
#Base de Jmater
FROM joabgonzalez/jmtb

#Metadatos
LABEL author="joabgonzalez" jmeter="master" target="latest"

#Creando Directorios
RUN mkdir tests \
    && mkdir results

#Puertos
EXPOSE 60000

#Memoria de Java
ENV _JAVA_OPTIONS "-Xms512m -Xmx4096m"

#Directorios
VOLUME ${JMETER_HOME}/tests
VOLUME ${JMETER_HOME}/results

dockerfile marvin-ai的Dockerfile

marvin-ai的Dockerfile

Dockerfile
FROM ubuntu:16.04

MAINTAINER Allan Batista <eu@allanbatista.com.br>

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install python2.7 libsasl2-dev python-pip vim curl git -y
RUN pip install --upgrade pip
RUN pip install virtualenvwrapper --ignore-installed six
RUN curl https://d3kbcqa49mib13.cloudfront.net/spark-2.1.1-bin-hadoop2.6.tgz -o /tmp/spark-2.1.1-bin-hadoop2.6.tgz && \
	tar -xf /tmp/spark-2.1.1-bin-hadoop2.6.tgz -C /opt/ && \
	ln -s /opt/spark-2.1.1-bin-hadoop2.6 /opt/spark && \
	echo "export SPARK_HOME=/opt/spark" >> $HOME/.bash_profile

RUN mkdir /opt/work
RUN mkdir /opt/virtual_env
WORKDIR /opt/work

ENV HOME=/opt/work
ENV WORKON_HOME=$HOME/.virtualenvs
ENV MARVIN_HOME=$HOME/marvin
ENV MARVIN_DATA_PATH=$HOME/marvin/data

RUN /bin/bash -c "source /usr/local/bin/virtualenvwrapper.sh && mkdir $MARVIN_HOME && mkdir $MARVIN_DATA_PATH && cd $MARVIN_HOME && git clone https://github.com/marvin-ai/marvin-python-toolbox.git && cd marvin-python-toolbox && mkvirtualenv python-toolbox-env && setvirtualenvproject && make marvin"

ENV MARVIN_ENGINE_HOME=$MARVIN_HOME/engine
ENV MARVIN_ENGINE_ENV=python-toolbox-env

RUN mkdir -p /opt/work/marvin/engine

RUN /bin/bash -c "cd $MARVIN_ENGINE_HOME && \
    source /usr/local/bin/virtualenvwrapper.sh && \
    mkvirtualenv $MARVIN_ENGINE_ENV"

RUN apt-get install graphviz -y

ENV SPARK_HOME=/opt/spark
ENV SPARK_CONF_DIR=$SPARK_HOME/conf
ENV HADOOP_CONF_DIR=$SPARK_CONF_DIR
ENV YARN_CONF_DIR=$SPARK_CONF_DIR

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

RUN /bin/bash -c "source /usr/local/bin/virtualenvwrapper.sh && \
    workon $MARVIN_ENGINE_ENV && \
    cd /opt/work/marvin/marvin-python-toolbox && marvin test"

RUN echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bash_profile
RUN echo "workon $MARVIN_ENGINE_ENV" >> ~/.bash_profile

CMD /bin/bash -c "source /usr/local/bin/virtualenvwrapper.sh && \
    workon $MARVIN_ENGINE_ENV && \
    cd /opt/work/marvin/marvin-python-toolbox"

dockerfile Docker与主管

Docker与主管

sshd.conf
[program:sshd]
directory=/usr/local/
command=/usr/sbin/sshd -D
autostart=true
autorestart=true
redirect_stderr=true
Dockerfile
FROM ubuntu

RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade

RUN apt-get install -y openssh-server supervisor
ADD sshd.conf /etc/supervisor/conf.d/sshd.conf

RUN mkdir -p /var/run/sshd

RUN echo "root:root" | chpasswd

EXPOSE 22

CMD /usr/bin/supervisord -n

dockerfile 用于eNMS的Dockerfile

用于eNMS的Dockerfile

Dockerfile_enms_flask
FROM ubuntu:latest
RUN apt-get update -y

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8

RUN apt-get update --fix-missing && apt-get install -y wget git bzip2 ca-certificates \
    libglib2.0-0 libxext6 libsm6 libxrender1 \
    git mercurial subversion nano iputils-ping

RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
    wget --quiet https://repo.continuum.io/miniconda/Miniconda2-4.3.27-Linux-x86_64.sh -O ~/miniconda.sh && \
    /bin/bash ~/miniconda.sh -b -p /opt/conda && \
    rm ~/miniconda.sh

RUN apt-get install -y curl grep sed dpkg && \
    TINI_VERSION=`curl https://github.com/krallin/tini/releases/latest | grep -o "/v.*\"" | sed 's:^..\(.*\).$:\1:'` && \
    curl -L "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.deb" > tini.deb && \
    dpkg -i tini.deb && \
    rm tini.deb && \
    apt-get clean

ENV PATH /opt/conda/bin:$PATH

ENV CONDA_ENV_PATH /opt/conda
ENV MY_CONDA_PY3ENV "python34"
ENV CONDA_ACTIVATE "source $CONDA_ENV_PATH/bin/activate $MY_CONDA_PY3ENV"

#Create CONDA
RUN conda create -y -n $MY_CONDA_PY3ENV python=3.4
RUN conda update --quiet --yes conda
RUN echo "alma101" # invalidate the cache
# Setup for ssh onto github
#
ADD ./requirements.txt /requirements.txt
RUN /bin/bash -c "$CONDA_ACTIVATE && pip install -r /requirements.txt"

#ENTRYPOINT [ "/usr/bin/tini", "--" ]
ENTRYPOINT [ "/bin/bash","-c"]
WORKDIR /app/eNMS/source
CMD [ "source activate python34 && export PORT=8080 && exec python flask_app.py"]
EXPOSE 8080

dockerfile 泊坞窗常用命令

泊坞窗常用命令

Dockerfile
# 删除所有none的image