Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crunchy Build instructions not working, documentation not current. #1298

Open
gijoe460 opened this issue Nov 23, 2020 · 4 comments
Open

Crunchy Build instructions not working, documentation not current. #1298

gijoe460 opened this issue Nov 23, 2020 · 4 comments

Comments

@gijoe460
Copy link

Describe the bug
Unable to build from source using the documented instructions.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://access.crunchydata.com/documentation/crunchy-postgres-containers/4.5.1/contributing/building/'
  2. Follow machine prep instructions, and type 'cd $CCPROOT' and then 'make postgres'
  3. build fails at step 15
  4. Error getting repository data for crunchypg12, repository not found
    error building at STEP "RUN ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False --disablerepo=crunchypg* --enablerepo="crunchypg${PG_LBL}" postgresql${PG_LBL} && ${PACKAGER} -y clean all": error while running runtime: exit status 1

Expected behavior
Base Image and Postgres Image local build to reside in local Docker registry after make Postgres command.

Screenshots
STEP 1: FROM centos:centos7
STEP 2: ARG BASEOS
--> Using cache c1c00ec1215e632af19a319eff047ed4eaaec334943d20ba3bc4a389c6a707d2
STEP 3: ARG RELVER
--> Using cache c2cd8689fb3b309b249370e05c038ced78371f5ec0f571c78a777e94e13030a7
STEP 4: ARG DFSET
--> Using cache d5cd6b540ea374b3bc3babefc3c01d87371d4fd94c07b99a7506c1be49faabe9
STEP 5: ARG PACKAGER
--> Using cache 9270ab2150e40e85476ca9b63edc3a06ac33c419dfd007380fe183925aa09c9c
STEP 6: MAINTAINER Crunchy Data info@crunchydata.com
--> Using cache 82fb03ae0f98ade093dbb9089f2ac863458db055f78c1b6413b3399bda152c76
STEP 7: LABEL vendor="Crunchy Data" url="https://crunchydata.com" release="${RELVER}" org.opencontainers.image.vendor="Crunchy Data" os.version="7.7"
--> Using cache fdf77777fa1d67b2ea2f7d937ea680baed24c49061924f4ef306ae67c4b5138b
STEP 8: COPY conf/licenses /licenses
--> Using cache a5532f8062a2296b31946cc61bb5ea89d6114967b12d77c1795eb90cb0daaab1
STEP 9: COPY redhat/atomic/help.1 /help.1
--> Using cache eaecc8c0166cf12e9112fd35ad5959c482004414c489a8ddc2c38fcfb5ef7569
STEP 10: COPY redhat/atomic/help.md /help.md
--> Using cache 424f4cacd336a2752dd3fe9f2a072e0f0584881eca343501e2a6bf3e865bae36
STEP 11: COPY licenses /licenses
--> Using cache 05838ea40fe9d044ce323e5d0e460ea88a208006445ed0896e4790153432bd4c
STEP 12: RUN if [ "$BASEOS" = "ubi8" ] ; then echo "INSIDE UBI8" ${PACKAGER} -y update && ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False glibc-langpack-en ; fi
--> Using cache 3647bec0875ee61e220f03c25da93d6af536ebf776b31ec677cd9ae4e974d737
STEP 13: ENV LC_ALL en_US.utf-8
--> Using cache 3870934a68907eb1110acf12f11e2f19b5b9cf13db2be4dc885e0de81fa88e85
STEP 14: ENV LANG en_US.utf-8
--> Using cache 271ea7d79e1ad1ccf316f9bf13c18b4bac42726e2be61351dcb19e8a5c6c8fde
STEP 15: ARG EPEL7_RPM=https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
--> Using cache f15152b01fea36d736341071f9df8589a477364136e2ea03e373b629493cd811
STEP 16: ARG EPEL8_RPM=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
--> Using cache 7f6dde00927af8ffa4a053cd0def3d3763f450cad4f32495a8461c696361a011
STEP 17: RUN if [ "$BASEOS" = "rhel7" ] ; then ${PACKAGER} -y --enablerepo=rhel-7-server-ose-3.11-rpms update && ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False ${EPEL7_RPM} bind-utils gettext hostname procps-ng && sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/epel*.repo && ${PACKAGER} -y clean all --enablerepo=rhel-7-server-ose-3.11-rpms ; fi
--> Using cache 37997838ddee0acd79fa59e41cf1f939ae33e33eef1bbdf5c2e3d0578c5e586d
STEP 18: RUN if [ "$BASEOS" = "ubi7" ] ; then ${PACKAGER} -y --enablerepo=rhel-7-server-ose-3.11-rpms update && ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False ${EPEL7_RPM} bind-utils gettext hostname procps-ng && sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/epel*.repo && ${PACKAGER} -y clean all --enablerepo=rhel-7-server-ose-3.11-rpms ; fi
--> Using cache bf5ad11d6573c3141d76e6f2daab39c318925ce52ee412baff7d827e2191703a
STEP 19: RUN if [ "$BASEOS" = "ubi8" ] ; then ${PACKAGER} -y update && ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False ${EPEL8_RPM} bind-utils gettext hostname procps-ng && sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/epel*.repo && ${PACKAGER} -y clean all ; fi
--> Using cache 197c208ee5d81ba9c8c727866b4b79baecf8b2c04a908c36d85c9d9e8a6e6942
STEP 20: RUN if [ "$BASEOS" = "centos7" ] ; then ${PACKAGER} -y update && ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False epel-release bind-utils gettext hostname procps-ng && ${PACKAGER} -y clean all ; fi
--> Using cache 835b42a3eca109fe4bbb3a1539256b5257499c9fd8690266bda88fa1820696b1
STEP 21: RUN if [ "$BASEOS" = "centos8" ] ; then ${PACKAGER} -y update && ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False epel-release glibc-langpack-en bind-utils gettext hostname procps-ng && ${PACKAGER} -y clean all ; fi
--> Using cache 6545fca32c7a32e9b535d2f0b4d91c0875761a1e6578ec465d81f2b21f32d977
STEP 22: COMMIT crunchydata/crunchy-base:centos7-12.5-4.5.1
6545fca32c7a32e9b535d2f0b4d91c0875761a1e6578ec465d81f2b21f32d977
6545fca32c7a32e9b535d2f0b4d91c0875761a1e6578ec465d81f2b21f32d977
sudo --preserve-env buildah push crunchydata/crunchy-base:centos7-12.5-4.5.1 docker-daemon:crunchydata/crunchy-base:centos7-12.5-4.5.1
Getting image source signatures
Copying blob 174f56854903 done
Copying blob 37e3777000c9 done
Copying blob 741782320d90 done
Copying blob 48a3eb5a3f28 done
Copying blob 52ebcd842f42 done
Copying blob d77eef042567 done
Copying blob 5f70bf18a086 done
Copying blob 5f70bf18a086 skipped: already exists
Copying blob 5f70bf18a086 skipped: already exists
Copying blob 4242151f42bc done
Copying blob 5f70bf18a086 skipped: already exists
Copying config 6545fca32c done
Writing manifest to image destination
Storing signatures
sudo --preserve-env buildah bud --layers
-f /home/redhat.user/cdev/src/github.com/crunchydata/crunchy-containers/build/pg-base/Dockerfile
-t crunchydata/crunchy-pg-base:centos7-12.5-4.5.1
--build-arg BASEOS=centos7
--build-arg BASEVER=4.5.1
--build-arg PG_FULL=12.5
--build-arg PG_LBL=12
--build-arg PG_MAJOR=12
--build-arg PREFIX=crunchydata
--build-arg DFSET=centos
--build-arg PACKAGER=yum
/home/redhat.user/cdev/src/github.com/crunchydata/crunchy-containers
STEP 1: FROM crunchydata/crunchy-base:centos7-12.5-4.5.1
STEP 2: ARG PG_FULL
--> Using cache 6a1b85e7da1784ab482d6aac67fc47b9af24d7d510de0a848bce44c4d7f69396
STEP 3: ARG BASEOS
--> Using cache 5f53059094eea5d050282c0be6d62b15a711a79485e853d06bb1182631487bab
STEP 4: ARG DFSET
--> Using cache dab137a4afb6d10f47d7c45d8e5eeed2b9c74b67ea7a8ba40fea84fa32871f0e
STEP 5: ARG PACKAGER
--> Using cache 0b4295f878a876882411bf83ff5d287b147f0a71bd27a7f889ebe3ae248de65d
STEP 6: ARG PG_MAJOR
--> Using cache 36b1654dc6a88e5ff1762e05bb1b7dafa9e1648cec62f99ee494dd17d611aa6a
STEP 7: ARG PG_LBL
--> Using cache 0299b0c44d5fc4ff3172494ec7ce3f17419b64458c810ef09011d195cbab7b64
STEP 8: LABEL postgresql.version.major="${PG_MAJOR}" postgresql.version="${PG_FULL}"
--> Using cache bed223691876b5828be246e80aeeb18e4a633eb2d04871b9aecec5b9588c8fa0
STEP 9: ADD conf/KEY /
--> Using cache 58b3b8055d0247e363f9349598e3ec5588bcf042dde7318563ea508fc981db2a
STEP 10: ADD conf/crunchypg${PG_LBL}.repo /etc/yum.repos.d/
--> Using cache bea09d2e92cedf82a4a65c5e5e304c57e470045d28a873723060049cba31fe83
STEP 11: RUN rpm --import RPM-GPG-KEY-crunchydata*
--> Using cache 39cc6d8fbc49d516c78013a5531511ae1fb199bc460abf3871aa8663267368e8
STEP 12: RUN if [ "$DFSET" = "rhel" ] ; then rpm --import CRUNCHY-GPG-KEY.public ; fi
--> Using cache 6599041314bc7a14bc3e95e2afc18587311c127954044c6abe0307bc10d747d7
STEP 13: RUN if [ "$BASEOS" = "centos8" ] ; then ${PACKAGER} -qy module disable postgresql ; fi
--> Using cache a72ec629ce2392dadac3da8633df29d562e9421043d5c087cf8b36c7420c0e99
STEP 14: RUN if [ "$BASEOS" = "ubi8" ] ; then ${PACKAGER} -qy module disable postgresql ; fi
--> Using cache 0356e1c76257983b4d4e8699420e75e1f2b8017466b90d8f4a3eb8d90d8833d6
STEP 15: RUN ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False --disablerepo=crunchypg* --enablerepo="crunchypg${PG_LBL}" postgresql${PG_LBL} && ${PACKAGER} -y clean all
Loaded plugins: fastestmirror, ovl

Error getting repository data for crunchypg12, repository not found
error building at STEP "RUN ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False --disablerepo=crunchypg* --enablerepo="crunchypg${PG_LBL}" postgresql${PG_LBL} && ${PACKAGER} -y clean all": error while running runtime: exit status 1
make: *** [cc-pg-base-image-build] Error 1

Please tell us about your environment:

  • Operating System: RedHat 7.7
  • Where is this running: Local
  • Storage being used (NFS, Hostpath, Gluster, etc): Local
  • Container Image Tag: centos7-12.5-4.5.1
  • PostgreSQL Version: 12.5
  • Platform (Docker, Kubernetes, OpenShift): Docker
  • Platform Version: Docker (CE) version 19.03.13
@gijoe460 gijoe460 changed the title Build from source failing on local machine Crunchy Build instructions not working, documentation not current. Feb 9, 2021
@MarekBiolik
Copy link

Change in build/..../Dockerfile (for example: build/postgres/Dockerfile)
"--enablerepo="crunchypg${PG_LBL}" \ " to "--enablerepo="crunchydatadevpg${PG_LBL}" "

explanation:
After downoload crunchypg12:
curl https://api.developers.crunchydata.com/downloads/repo/rpm-centos/postgresql12/crunchypg12.repo > conf/crunchypg12.repo

in DockerFile is copy to etc/yum.repos.d/:
ADD conf/crunchypg${PG_LBL}.repo /etc/yum.repos.d/

and then in step 15 is install:
STEP 15: RUN ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False --disablerepo=crunchypg* --enablerepo="crunchypg${PG_LBL}" postgresql${PG_LBL} && ${PACKAGER} -y clean all

but if you check before install name of repo is:
crunchydatadevpg12 no crunchypg12

image

@rmccarth
Copy link

has the proper fix for this been documented/applied?

@gijoe460
Copy link
Author

I just followed the instructions from a clean system. Make Postgres still failed with same error.
I then applied the fix in the above post, and @MarekBiolik was correct, it did fix the build.

@rmccarth
Copy link

rmccarth commented Mar 12, 2021

For anyone stumbling across this issue the solution is to change an entry in the Dockerfile. (build/[your desired container]/Dockerfile).

RUN ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False --disablerepo=crunchypg* --enablerepo="crunchypg${PG_LBL}" postgresql${PG_LBL} && ${PACKAGER} -y clean all

should be changed to

RUN ${PACKAGER} -y install --setopt=skip_missing_names_on_install=False --disablerepo=crunchypg* --enablerepo="crunchydatadevpg${PG_LBL}" postgresql${PG_LBL} && ${PACKAGER} -y clean all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants