root/build-tools/build-docker-images
Scott Little 32c08a8dd4 build-stx-base.sh --latest --clean fails to clean the latest image
When both --latest and --clean flags are passed to build-stx-base.sh
we expect the docker image tagged as '...-latest' to be deleted
from the local build environment.

This did not occure ...

starlingx/stx-centos      dev-latest          279c713e0b5d        7
hours ago         331MB
starlingx/stx-centos      <none>              dda342637517        19
hours ago        331MB

Adding a code block to handle the case when these flags are combined.

Closes-Bug: 1808544
Change-Id: Ic2d17bc285f3746965c2a5e7ec49c278f0fbf066
Signed-off-by: Scott Little <scott.little@windriver.com>
2018-12-14 10:49:37 -05:00
..
stx-centos Add tools for building StarlingX docker images 2018-11-19 13:43:38 -06:00
README Add greater flexibility in docker image naming 2018-12-10 13:11:09 -05:00
build-stx-base.sh build-stx-base.sh --latest --clean fails to clean the latest image 2018-12-14 10:49:37 -05:00
build-stx-images.sh Add greater flexibility in docker image naming 2018-12-10 13:11:09 -05:00

README

## Example commands for building StarlingX images

PRIVATE_REGISTRY_USERID=myuser
PRIVATE_REGISTRY=xxx.xxx.xxx.xxx:9001
VERSION=2018.11.13
OS=centos
OS_VERSION=7.5.1804
OPENSTACK_RELEASE=pike
HOST_PORT=8088

## Step 1: Build stx-centos
time $MY_REPO/build-tools/build-docker-images/build-stx-base.sh \
    --os ${OS} \
    --os-version ${OS_VERSION} \
    --version ${VERSION} \
    --user ${PRIVATE_REGISTRY_USERID} \
    --registry ${PRIVATE_REGISTRY} \
    --push \
    --repo stx-local-build,http://${HOSTNAME}:${HOST_PORT}/${MY_WORKSPACE}/std/rpmbuild/RPMS \
    --repo stx-mirror-distro,http://${HOSTNAME}:${HOST_PORT}/${MY_REPO}/cgcs-root/cgcs-${OS}-repo/Binary \
    --clean


## Step 2: Build wheels (output as tarball)
time $MY_REPO/build-tools/build-wheels/build-wheel-tarball.sh \
    --os ${OS} \
    --os-version ${OS_VERSION} \
    --release ${OPENSTACK_RELEASE}

## Step 3: Build images
time $MY_REPO/build-tools/build-docker-images/build-stx-images.sh \
    --os ${OS} \
    --version ${VERSION} \
    --release ${OPENSTACK_RELEASE} \
    --base ${PRIVATE_REGISTRY}/${PRIVATE_REGISTRY_USERID}/stx-${OS}:${VERSION} \
    --wheels http://${HOSTNAME}:${HOST_PORT}/${MY_WORKSPACE}/std/build-wheels-${OS}-${OPENSTACK_RELEASE}/stx-${OS}-${OPENSTACK_RELEASE}-wheels.tar \
    --user ${PRIVATE_REGISTRY_USERID} \
    --registry ${PRIVATE_REGISTRY} \
    --push --latest \
    --clean


## Note: Verify that lighttpd is not bound to "localhost"
vi /etc/lighttpd/lighttpd.conf
# server.bind = "localhost"
systemctl restart lighttpd

## Note: You may need to add an iptables rule to allow the docker
## containers to access the http server on your host. For example:
iptables -I INPUT 6 -i docker0 -p tcp --dport ${HOST_PORT} -m state --state NEW,ESTABLISHED -j ACCEPT