forked from vmware/vic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix building iso issues and rectify documents
Correct readme for building iso since docker is required now. Use PKGMGR as var name for tdnf and yum to keep consistence with other scripts in build-image.sh and docker-iso-build.sh. Use docker info to determine if docker-iso-build.sh is running in a container or not. Move defining environment variable TERM to Dockerfile. Add comments in Dockerfile to show what are these images used for and how to use them and list packages for detail usages. Change base yum os to centos:6.9 which is more close to rehl 6.9. Remove duplicated steps of package installation in Dockerfile.yum. Remove bootstrap-debug and bootstrap-staging-debug since it is not maintained. Remove hard coding on entropy configure path. Remove a debug scrip that was not being used or maintained. Add necessary packages and checks to the Dockerfiles for the build images and checks for packages in related scripts. Go 1.8.7 generates binaries that are incompatible with the 2.6.32 kernel. We see "FATAL: kernel too old" to execute tether. Use go 1.8.6 instead. Sets the expected build context to be infra/build-image so that we don't send a huge build context to build a tiny image. Restores the function that allows specification of branches and pull requests but in such a way that current usage is preserved. Because make iso and unit test use different image, separate them to different step in drone configuration. Remove using CI repo and use photon-2.0 directly for CI build.
- Loading branch information
1 parent
a0a1753
commit f9a0c67
Showing
11 changed files
with
128 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,53 @@ | ||
# docker build -t vic-build-image-tdnf -f infra/build-image/Dockerfile.tdnf . | ||
# This is an image used for building bootstrap.iso and application.iso with photon 2.0 operate system. | ||
# | ||
# To use this image: | ||
# docker run -v $(pwd):/go/src/github.com/vmware/vic gcr.io/eminent-nation-87317/vic-build-image:tdnf make most | ||
# | ||
# To build this image: | ||
# docker build -t vic-build-image-tdnf -f infra/build-image/Dockerfile.tdnf infra/build-image/ | ||
# docker tag vic-build-image-tdnf gcr.io/eminent-nation-87317/vic-build-image:tdnf | ||
# gcloud auth login | ||
# gcloud docker -- push gcr.io/eminent-nation-87317/vic-build-image:tdnf | ||
|
||
FROM vmware/photon:2.0 | ||
FROM photon:2.0 | ||
|
||
ENV GOROOT /usr/local/go | ||
ENV GOPATH /go | ||
ENV PATH $PATH:${GOPATH}/bin:/${GOROOT}/bin | ||
ENV SRCDIR ${GOPATH}/src/github.com/vmware/vic | ||
ENV TERM linux | ||
ENV VIC_CACHE_DEPS=1 | ||
|
||
WORKDIR ${SRCDIR} | ||
|
||
# gawk added purely for tolower function used in Makefile | ||
# rpm used for initialize_bundle - tdnf seems to require rpm -initdb to work | ||
# kmod is needed for depmod command | ||
# need the following for configure | ||
# expr for xorriso configure which toybox doesn't have | ||
# Go compilation step requires the following | ||
# sed | ||
# gcc | ||
# binutils | ||
# glibc-devel | ||
# linux-api-headers - like kernel-headers but named this | ||
# binutils | ||
# glibc-devel | ||
# linux-api-headers - like kernel-headers but named this | ||
# findutils - for xargs for go-deps script (also in toybox if not using coreutils) | ||
# cpio - this ensures that we don't need to change the vic scripts based on toybox or not-toybox | ||
# it seems that erasing toybox automatically installs coreutils | ||
RUN tdnf erase -y toybox && tdnf install -y jq cpio git tar gzip make xz gawk rpm kmod sed gcc binutils glibc-devel linux-api-headers findutils | ||
|
||
ADD https://dl.google.com/go/go1.8.7.linux-amd64.tar.gz /tmp/go.tgz | ||
# which is used to check for other utilities | ||
# jq is used for parse repo-spec.json | ||
# git is used for retrieving tag and commit information | ||
# tar gzip xz are used for compression | ||
# make for Makefile | ||
# xorriso is used for building iso file | ||
RUN tdnf erase -y toybox && \ | ||
tdnf install -y jq cpio git tar gzip make xz gawk rpm kmod sed which \ | ||
gcc binutils glibc-devel linux-api-headers findutils xorriso | ||
|
||
ADD https://dl.google.com/go/go1.8.6.linux-amd64.tar.gz /tmp/go.tgz | ||
RUN cd /usr/local && tar -zxf /tmp/go.tgz | ||
|
||
ADD https://www.gnu.org/software/xorriso/xorriso-1.4.8.tar.gz /usr/local/src/xorriso.tgz | ||
RUN cd /usr/local/src && tar -zxf xorriso.tgz | ||
RUN cd /usr/local/src/xorriso-1.4.8 && ./configure && make && make install && make distclean | ||
|
||
RUN mkdir -p ${SRCDIR} | ||
|
||
COPY infra/build-image/setup-repo.sh /usr/local/bin | ||
COPY setup-repo.sh /usr/local/bin | ||
RUN chmod a+x /usr/local/bin/setup-repo.sh | ||
|
||
# ENTRYPOINT [ "/usr/local/bin/setup-repo.sh" ] | ||
ENTRYPOINT [ "/usr/local/bin/setup-repo.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,52 @@ | ||
# docker build -t vic-build-image-yum -f infra/build-image/Dockerfile.yum . | ||
# This is an image used for building bootstrap.iso and application.iso with centos 6.9 operate system. | ||
# | ||
# To use this image: | ||
# docker run -v $(pwd):/go/src/github.com/vmware/vic gcr.io/eminent-nation-87317/vic-build-image:yum make most | ||
# | ||
# To build this image: | ||
# docker build -t vic-build-image-yum -f infra/build-image/Dockerfile.yum infra/build-image/ | ||
# docker tag vic-build-image-yum gcr.io/eminent-nation-87317/vic-build-image:yum | ||
# gcloud auth login | ||
# gcloud docker -- push gcr.io/eminent-nation-87317/vic-build-image:yum | ||
|
||
FROM centos:7 | ||
FROM centos:6.9 | ||
|
||
ENV GOROOT /usr/local/go | ||
ENV GOPATH /go | ||
ENV PATH $PATH:${GOPATH}/bin:/${GOROOT}/bin | ||
ENV SRCDIR ${GOPATH}/src/github.com/vmware/vic | ||
ENV TERM linux | ||
ENV VIC_CACHE_DEPS=1 | ||
|
||
WORKDIR ${SRCDIR} | ||
|
||
# rpm used for initialize_bundle - yum seems to require rpm -initdb to work | ||
# Go compilation step requires the following | ||
# sed | ||
# gcc | ||
# binutils | ||
# glibc-devel | ||
# glibc-static | ||
# cpio - this ensures that we don't need to change the vic scripts based on toybox or not-toybox | ||
# it seems that erasing toybox automatically installs coreutils | ||
# jq is used for parse repo-spec.json | ||
# git is used for retrieving tag and commit information | ||
# tar gzip xz are used for compression | ||
# make for Makefile | ||
# xorriso is used for building iso file | ||
# epel-release allow yum to install packages and dependencies | ||
RUN set -ex; \ | ||
yum install -y epel-release; \ | ||
yum install -y \ | ||
jq cpio git tar gzip make rpm kmod sed gcc \ | ||
binutils glibc-devel wget; | ||
|
||
RUN set -ex; \ | ||
yum install -y epel-release; | ||
|
||
RUN set -ex; \ | ||
yum install -y xorriso; | ||
|
||
RUN set -ex; \ | ||
wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64; \ | ||
mv jq-linux64 jq; \ | ||
install -t /usr/local/bin jq; | ||
jq cpio git tar gzip make rpm sed gcc \ | ||
binutils glibc-devel xorriso glibc-static; | ||
|
||
ADD https://dl.google.com/go/go1.8.7.linux-amd64.tar.gz /tmp/go.tgz | ||
ADD https://dl.google.com/go/go1.8.6.linux-amd64.tar.gz /tmp/go.tgz | ||
RUN cd /usr/local && tar -zxf /tmp/go.tgz | ||
|
||
RUN mkdir -p ${SRCDIR} | ||
|
||
COPY infra/build-image/setup-repo.sh /usr/local/bin | ||
COPY setup-repo.sh /usr/local/bin | ||
RUN chmod a+x /usr/local/bin/setup-repo.sh | ||
|
||
# ENTRYPOINT [ "/usr/local/bin/setup-repo.sh" ] | ||
ENTRYPOINT [ "/usr/local/bin/setup-repo.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.