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

Fix and test Dockerfile builds #31

Merged
merged 1 commit into from
Aug 16, 2023
Merged

Fix and test Dockerfile builds #31

merged 1 commit into from
Aug 16, 2023

Conversation

leifmadsen
Copy link
Member

When making fixes in #29 related to lint checks, a local build wasn't
done against the Dockerfile, which has a different base image from that
used by build_checks for lint verification. The result of that was that
building sg-bridge with the Dockerfile failed on gcc compiling due to
hardening instructions not being available.

This commit does the following:

  • adds the RPM dependency to the build layer of Dockerfile to install
    hardening instructions for gcc
  • changes the default -march CFLAG to be x86-64 instead of x86-64-v2
    which fails in ubi8
  • updates the GHA to add a build check against the Dockerfile and not
    just run build_checks.sh for future validation

Found by csibbitt and noted in chat.

Resolves #30

Signed-off-by: Leif Madsen lmadsen@redhat.com

When making fixes in #29 related to lint checks, a local build wasn't
done against the Dockerfile, which has a different base image from that
used by build_checks for lint verification. The result of that was that
building sg-bridge with the Dockerfile failed on gcc compiling due to
hardening instructions not being available.

This commit does the following:

* adds the RPM dependency to the build layer of Dockerfile to install
  hardening instructions for gcc
* changes the default -march CFLAG to be x86-64 instead of x86-64-v2
  which fails in ubi8
* updates the GHA to add a build check against the Dockerfile and not
  just run build_checks.sh for future validation

Found by csibbitt and noted in chat.

Resolves #30

Signed-off-by: Leif Madsen <lmadsen@redhat.com>
@leifmadsen leifmadsen requested a review from csibbitt August 15, 2023 17:43
Copy link
Contributor

@csibbitt csibbitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I successfully tested this in an STO local CI build, which is where I found it failing:

$ ansible-playbook --extra-vars working_branch=lmadsen/fix-building --extra-vars __local_build_enabled=true --extra-vars __service_telemetry_snmptraps_enabled=true --extra-vars __service_telemetry_observability_strategy=use_redhat --extra-vars __deploy_stf=false ./build/run-ci.yaml
[...]
            "outputDockerImageReference": "image-registry.openshift-image-registry.svc:5000/service-telemetry/sg-bridge:latest",                                                         
            "phase": "Complete",
[...]
PLAY RECAP ******************************************************************************************************************************************************************************
localhost                  : ok=108  changed=30   unreachable=0    failed=0    skipped=26   rescued=3    ignored=0

$ oc get build sg-bridge-2
NAME          TYPE     FROM             STATUS     STARTED         DURATION
sg-bridge-2   Docker   Binary@97205fe   Complete   4 minutes ago   50s

@csibbitt csibbitt merged commit be893b7 into master Aug 16, 2023
@csibbitt csibbitt deleted the lmadsen/fix-building branch August 16, 2023 14:14
@leifmadsen leifmadsen mentioned this pull request Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Builds fail using Dockerfile
2 participants