A docker image that builds, tests and pushes docker images from Dockerfile, tarball or git repositories.
The docker image - containerops/builder can be generated as the way below:
git clone https://github.com/ChengTiesheng/build-test.git
cd build-test
make
make imageRun the following docker command:
docker run --rm -it --privileged -e IMAGE_NAME=$IMAGE_NAME -e USERNAME=$USERNAME -e PASSWORD=$PASSWORD -e EMAIL=$EMAIL -e DOCKERFILE_URL=$DOCKERFILE_URL containerops/builder
Where:
$DOCKERFILE_URLis the URL to theDockerfileis to download and build.$IMAGE_NAMEis the name of the image to create with an optional tag, i.e.user/image-test:latest$USERNAMEis the username to use to log into the registry usingdocker login$PASSWORDis the password to use to log into the registry usingdocker login$EMAIL(optional) is the email to use to log into the registry usingdocker login
Run the following docker command:
docker run --rm -it --privileged -e IMAGE_NAME=$IMAGE_NAME -e GIT_USER=$GIT_USER -e GIT_REPO=$GIT_REPO -e GIT_TAG=$GIT_TAG -e USERNAME=$USERNAME -e PASSWORD=$PASSWORD -e EMAIL=$EMAIL containerops/builder
Where:
$GIT_USERis the user name of git hub, i.e.huawei-openlabinhttps://github.com/huawei-openlab/oci2aci$GIT_REPOis the git repository to clone and build, i.e.oci2aciinhttps://github.com/huawei-openlab/oci2aci$GIT_TAG(optional, defaults tomaster) is the tag/branch/commit to checkout after clone, i.e.master$IMAGE_NAMEis the name of the image to create with an optional tag, i.e.user/image-test:latest$USERNAMEis the username to use to log into the registry usingdocker login$PASSWORDis the password to use to log into the registry usingdocker login$EMAIL(optional) is the email to use to log into the registry usingdocker login
Run the following docker command:
docker run --rm -it --privileged -e IMAGE_NAME=$IMAGE_NAME -e TGZ_URL=$TGZ_URL -e USERNAME=$USERNAME -e PASSWORD=$PASSWORD -e EMAIL=$EMAIL containerops/builder
Where:
$TGZ_URLis the URL to the compressed tarball (.tgz) to download and build.$IMAGE_NAMEis the name of the image to create with an optional tag, i.e.user/image-test:latest$USERNAMEis the username to use to log into the registry usingdocker login$PASSWORDis the password to use to log into the registry usingdocker login$EMAIL(optional) is the email to use to log into the registry usingdocker login