zoukankan      html  css  js  c++  java
  • buildah

    
    
    #cp /etc/containers/registries.conf /etc/containers/registries.conf.bak
    
    unqualified-search-registries = ["docker.io"]
    
    [[registry]]
    prefix = "docker.io"
    location = "xxxxxx.mirror.aliyuncs.com"
    
    [[registry.mirror]]
    prefix = "docker.io"
    location = "hub-mirror.c.163.com"
    
    id=$(buildah from --pull node:10)
    buildah run $id mkdir -p /usr/src/app
    buildah config --label maintainer ="Chris Collins <collins.christopher@gmail.com>" $id
    buildah config --workingdir /usr/src/app $id
    buildah copy $id $PWD .
    buildah run --net host $id npm install
    buildah config --port 1337 --entrypoint '["npm", "start"]' $id
    buildah commit $id example-app
    
    
    buildah push hello:latest docker-daemon:hello:latest
    
    
    #!/usr/bin/env bash
    set -o errexit
    # Create a container
    container=$(buildah from fedora:28)
    # Labels are part of the "buildah config" command
    buildah config --label maintainer="Chris Collins <collins.christopher@gmail.com>" $container
    # Grab the source code outside of the container
    curl -sSL http://ftpmirror.gnu.org/hello/hello-2.10.tar.gz -o hello-2.10.tar.gz
    buildah copy $container hello-2.10.tar.gz /tmp/hello-2.10.tar.gz
    buildah run $container dnf install -y tar gzip gcc make
    buildah run $container dnf clean all
    buildah run $container tar xvzf /tmp/hello-2.10.tar.gz -C /opt
    # Workingdir is also a "buildah config" command
    buildah config --workingdir /opt/hello-2.10 $container
    buildah config --env _BUILDAH_STARTED_IN_USERNS="" --env BUILDAH_ISOLATION=chroot
    buildah run $container ./configure
    buildah run $container make
    buildah run $container make install
    buildah run $container hello -v
    # Entrypoint, too, is a “buildah config” command
    buildah config --entrypoint /usr/local/bin/hello $container
    # Finally saves the running container to an image
    buildah commit --format docker $container hello:latest
    
    buildah from --name cakephp4x php:7.4-fpm
    buildah images
    buildah run cakephp4x apt-get update --yes
    buildah config --workingdir "/opt" cakephp4x
    buildah run cakephp4x curl -sS https://getcomposer.org/installer -o composer-setup.php
    buildah run cakephp4x php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.21
    buildah run cakephp4x rm composer-setup.php    
    buildah run cakephp4x apt-get install --yes libfreetype6-dev libjpeg62-turbo-dev libpng-dev libzip-dev libicu-dev git unzip
    buildah run cakephp4x docker-php-ext-configure gd --with-freetype --with-jpeg
    buildah run cakephp4x docker-php-ext-install -j$(nproc) intl pdo_mysql zip gd pcntl
    buildah run cakephp4x git clone https://github.com/hui-ho/WebStack-Laravel.git
    buildah config --workingdir "/opt/WebStack-Laravel" cakephp4x
    buildah run cakephp4x composer install
    
    buildah run composer create-project --no-interaction --prefer-dist cakephp/app:~4.0 cakephp4x_app
    buildah config --workingdir "/opt/cakephp4x_app" cakephp4x
    buildah config --cmd php bin/cake.php server -H 0.0.0.0 -p 8080
    
  • 相关阅读:
    firewall&iptables
    Linux压缩&解压缩
    Centos7.4 修改selinux错误导致服务器起不来
    Anaconda 安装 pytorch报错解决方法
    Java8 map value排序
    SparkStreaming获取kafka数据的两种方式:Receiver与Direct
    vim常用的骚操作
    http server
    转:WinInet, WinHttp, Winsock, ws2_32的区别和联系
    windows xp 驱动开发(三)DDK与WDK WDM的区别
  • 原文地址:https://www.cnblogs.com/yzpopulation/p/14700025.html
Copyright © 2011-2022 走看看