dockerfile 用于以太坊bootnode的Dockerfile

用于以太坊bootnode的Dockerfile

Dockerfile
FROM ubuntu:xenial

MAINTAINER Tim Zöller <mail@tim-zoeller.de>

RUN apt-get update \
     && apt-get install -y wget \
     && rm -rf /var/lib/apt/lists/* 

WORKDIR "/opt"
ARG BINARY="geth-alltools-linux-amd64-1.8.1-1e67410e.tar.gz"
RUN wget "https://gethstore.blob.core.windows.net/builds/$BINARY"
RUN tar -xzvf $BINARY --strip 1
RUN rm $BINARY

ENV nodekeyhex=""
CMD exec ./bootnode -nodekeyhex $nodekeyhex

EXPOSE 30301/udp
EXPOSE 30303/udp

dockerfile Rustlang Dockerfile

这个Dockerfile将构建并测试Rust应用程序。

Dockerfile
FROM rust:1.30.0
ADD . "/usr/src/wintermute"
WORKDIR "/usr/src/wintermute"
RUN ["rustup", "default", "nightly"]
RUN ["cargo", "install", "--force", "cargo-make"]
RUN ["rustup", "component", "add", "rustfmt-preview"]
RUN ["rustup", "component", "add", "clippy-preview"]
RUN ["cargo", "make"]

dockerfile 詹金斯码头与码头工人cmd

Dockerfile
FROM jenkins/jenkins:latest

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

dockerfile Debian + PHP7.2 + Blackfire + Meminfo

Debian + PHP7.2 + Blackfire + Meminfo

blackfire.ini
[blackfire]
;
; This is a configuration file for Blackfire.
;

;
; setting: ca-cert
; desc   : Sets the PEM encoded certificates to use
; default:
ca-cert=

;
; setting: client-id
; desc   : Sets the Client ID used for API authentication
; default:
client-id=

;
; setting: client-token
; desc   : Sets the Client Token used for API authentication
; default:
client-token=

;
; setting: endpoint
; desc   : Sets the API endpoint
; default: https://blackfire.io
endpoint=https://blackfire.io

;
; setting: http-proxy
; desc   : Sets the HTTP proxy to use
; default:
http-proxy=

;
; setting: https-proxy
; desc   : Sets the HTTPS proxy to use
; default:
https-proxy=

;
; setting: timeout
; desc   : Sets the Blackfire API connection timeout
; default: 15s
timeout=15s
agent
[blackfire]
;
; This is a configuration file for Blackfire's Agent.
;

;
; setting: ca-cert
; desc   : Sets the PEM encoded certicates
; default:
ca-cert=

;
; setting: collector
; desc   : Sets the URL of Blackfire's data collector
; default: https://blackfire.io
collector=https://blackfire.io

;
; setting: http-proxy
; desc   : Sets the http proxy to use
; default:
http-proxy=

;
; setting: https-proxy
; desc   : Sets the https proxy to use
; default:
https-proxy=

;
; setting: log-file
; desc   : Sets the path of the log file. Use stderr to log to stderr
; default: stderr
log-file=stderr

;
; setting: log-level
; desc   : log verbosity level (4: debug, 3: info, 2: warning, 1: error)
; default: 1
log-level=1

;
; setting: server-id
; desc   : Sets the server id used to authenticate with Blackfire API
; default:
server-id=

;
; setting: server-token
; desc   : Sets the server token used to authenticate with Blackfire API. It is unsafe to set this from the command line
; default:
server-token=

;
; setting: socket
; desc   : Sets the socket the agent should read traces from. Possible value can be a unix socket or a TCP address. ie: unix:///var/run/blackfire/agent.sock or tcp://127.0.0.1:8307
; default: unix:///usr/local/var/run/blackfire-agent.sock
socket=unix:///usr/local/var/run/blackfire-agent.sock

;
; setting: spec
; desc   : Sets the path to the json specifications file
; default:
spec=
Dockerfile
FROM debian:latest

RUN apt-get update && \
    apt-get install apt-transport-https lsb-release ca-certificates wget unzip gnupg -y && \
    wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
    wget -q -O - https://packagecloud.io/gpg.key | apt-key add - && \
    echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" >> /etc/apt/sources.list.d/php.list && \
    echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list && \
    apt-get update

RUN apt-get install -y php7.2-dev php7.2-xml php7.2 zip build-essential git blackfire-agent blackfire-php -f
COPY agent /etc/blackfire/agent
COPY blackfire.ini /root/.blackfire.ini
RUN /etc/init.d/blackfire-agent restart

RUN git clone https://github.com/mbonneau/php-meminfo /php-meminfo && \
    cd /php-meminfo && git fetch origin && git checkout --track origin/segfault && \
    cd /php-meminfo/analyzer/ && \
    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
    php composer-setup.php && \
    php -r "unlink('composer-setup.php');" && \
    mv composer.phar /usr/local/bin/composer && \
    composer install && \
    cd /php-meminfo/extension/php7 && \
    phpize && \
    ./configure --enable-meminfo && \
    make && \
    make install && \
    echo 'extension=meminfo.so' >> /etc/php/7.2/cli/php.ini

#CMD tail -f /dev/null
WORKDIR /code

dockerfile Exampel Dockerfile节点app + nginx

生产实例

dockerfile
#==================== Building Stage ================================================ 

# Create the image based on the official Node 8.9.0 image from Dockerhub
FROM node:9

# Create a directory where our app will be placed. This might not be necessary
RUN mkdir -p /app

# Change directory so that our commands run inside this new directory
WORKDIR /app

# Copy dependency definitions
COPY package.json /app

# Install dependencies using npm
RUN npm install

# Get all the code needed to run the app
COPY . /app

# Expose the port the app runs in
EXPOSE 4200

#Build the app
RUN npm run build

#==================== Setting up stage ==================== 
# Create image based on the official nginx - Alpine image
FROM nginx:1.13.7-alpine

COPY --from=node /app/dist/ /usr/share/nginx/html

COPY ./nginx-app.conf /etc/nginx/conf.d/default.conf

dockerfile Dockerfile jsonserver

Dockerfile jsonserver

Dockerfile
FROM node
WORKDIR api/
COPY ./db.json .
RUN npm install -g json-server
EXPOSE 80
CMD json-server -p 80 --host 0.0.0.0 --watch db.json

dockerfile Dockerfile

Dockerfile
# Use an official Python runtime as a parent image
FROM python:2.7-slim

# Set the working directory to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt

# Make port 80 available to the world outside this container
EXPOSE 80

# Define environment variable
ENV NAME World

# Run app.py when the container launches
CMD ["python", "app.py"]

dockerfile Dockerfile

Flask
# Use an official Python runtime as a parent image
FROM python:2.7-slim

# Set the working directory to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt

# Make port 80 available to the world outside this container
EXPOSE 80

# Define environment variable
ENV NAME World

# Run app.py when the container launches
CMD ["python", "app.py"]

dockerfile docker热门镜像创建

SpringBoot-Dockerfile
# SpringBoot
FROM frolvlad/alpine-oraclejdk8:slim
VOLUME /tmp
ADD spring-boot-docker-example-0.0.1-SNAPSHOT.jar application.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/application.jar"]
RoR-Dockerfile
# Ruby-On-Rails
FROM ruby:2.5.1-slim

# 安装数据库以及编译依赖文件必须的库
RUN apt-get update && apt-get install -y libsqlite3-dev build-essential

RUN mkdir /app
WORKDIR /app

COPY . .

RUN bundle install

CMD ["rails", "s", "-d"]

dockerfile 用于rails的Dockerfile

Dockerfile
FROM ruby:2.5.1-alpine
LABEL maintainer='kuboon@trick-with.net'

ENV LANG C.UTF-8
ENV VIRTUAL_PACKAGES build-base curl-dev ruby-dev postgresql-dev yaml-dev
ENV REQUIRED_PACKAGES bash git ruby-json tzdata nodejs postgresql

RUN apk update && \
    apk upgrade && \
    apk --no-cache --virtual=.build-deps add $VIRTUAL_PACKAGES && \
    apk --no-cache add $REQUIRED_PACKAGES && \
    apk del .build-deps &&\
    rm -rf /var/cache/apk/*

WORKDIR /app
ADD Gemfile Gemfile.lock /app/
RUN bundle install --without development test --jobs `expr $(cat /proc/cpuinfo | grep -c "cpu cores") - 1` --retry 3
COPY . .
RUN chown -R nobody:nogroup /app
RUN chmod +x run.sh

CMD ["./run.sh"]