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
posted @ 2021-04-25 14:01  月渊  阅读(173)  评论(0编辑  收藏  举报