DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Docker Model Runner: Streamlining AI Deployment for Developers
  • A Guide to Container Runtimes
  • Gemma 3: Unlocking GenAI Potential Using Docker Model Runner
  • Docker vs Kubernetes: Which to Use and When?

Trending

  • Designing a Java Connector for Software Integrations
  • Mastering Advanced Aggregations in Spark SQL
  • Developers Beware: Slopsquatting and Vibe Coding Can Increase Risk of AI-Powered Attacks
  • Memory Leak Due to Time-Taking finalize() Method
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Install Anypoint Flex Gateway (Connected Mode) On Docker With RedHat 8.2

Install Anypoint Flex Gateway (Connected Mode) On Docker With RedHat 8.2

Follow the steps in this tutorial to install Anypoint Flex Gateway on Docker with RedHat 8.2 to protect APIs.

By 
Sadik Ali user avatar
Sadik Ali
DZone Core CORE ·
May. 27, 22 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
6.7K Views

Join the DZone community and get the full member experience.

Join For Free

Follow the steps in this tutorial to install Anypoint Flex Gateway on Docker with RedHat 8.2 to protect APIs. There are several discussions about non-compatibilities in regards to Docker and RedHat 8. While installing in Ubuntu, I have not found any difficulty. 

Installing RedHat 8

Let's try and install the version of RedHat 8 on the server as below.

Shell
 
[root@docker-flex ~]# hostnamectl
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 01f1fc6758fc4be0ac74ff2d131626fb
           Boot ID: 03a60ed7c9da4f3eb099e341b4c00d8b
    Virtualization: oracle
  Operating System: Red Hat Enterprise Linux 8.6 (Ootpa)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:8::baseos
            Kernel: Linux 4.18.0-372.9.1.el8.x86_64
      Architecture: x86-64
[root@docker-flex ~]#


Install RedHat8


Note: The package below needs to update on the server. It features server capabilities with yum-manager.

sudo yum install -y yum-utils


A Few Points About RedHat 8

The dnf config-manager utility allows us to execute several processes, such as enabling or disabling repositories. In general, there are a few repositories installed on RedHat 8, such as AppStream and BaseOS repositories.

After several efforts, the result was found that many Docker Engines are not built to support RedHat architecture. Here is the evidence:

Shell
 
[root@docker-flex ~]# sudo dnf install  https://download.docker.com/linux/rhel/8/s390x/stable/Package                                                                s/containerd.io-1.4.11-3.1.el8.s390x.rpm
Updating Subscription Management repositories.
Last metadata expiration check: 0:08:29 ago on Wed 25 May 2022 08:27:08 AM EDT.
containerd.io-1.4.11-3.1.el8.s390x.rpm                                12 MB/s |  23 MB     00:01
Error:
 Problem: conflicting requests
  - package containerd.io-1.4.11-3.1.el8.s390x does not have a compatible architecture
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candida                                                                te packages)
[root@docker-flex ~]# sudo dnf install  https://download.docker.com/linux/rhel/8


While following the recommended approach with skip/--nobest, I was without any successful result.

Shell
 
[root@docker-flex ~]# sudo dnf install  https://download.docker.com/linux/rhel/8/s390x/stable/Package                                                                s/containerd.io-1.4.11-3.1.el8.s390x.rpm --nobest --skip-broken
Updating Subscription Management repositories.
Last metadata expiration check: 0:09:14 ago on Wed 25 May 2022 08:27:08 AM EDT.
containerd.io-1.4.11-3.1.el8.s390x.rpm                                12 MB/s |  23 MB     00:01
Dependencies resolved.

 Problem: conflicting requests
  - package containerd.io-1.4.11-3.1.el8.s390x does not have a compatible architecture
Nothing to do.
Complete!
[root@docker-flex ~]# l


Finally, I changed the package, and it worked.

Shell
 
sudo dnf config-manager \
> --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
Updating Subscription Management repositories.
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
[root@redhat-node-one ~]#  sudo dnf install docker-ce
Updating Subscription Management repositories.
Docker CE Stable - x86_64                                                                                                           98 kB/s |  25 kB     00:00
Dependencies resolved.
===================================================================================================================================================================
 Package                               Architecture       Version                                               Repository                                    Size
===================================================================================================================================================================
Installing:
 docker-ce                             x86_64             3:20.10.16-3.el8                                      docker-ce-stable                              22 M
Installing dependencies:
 container-selinux                     noarch             2:2.179.1-1.module+el8.6.0+14877+f643d2d6             rhel-8-for-x86_64-appstream-rpms              58 k
 containerd.io                         x86_64             1.6.4-3.1.el8                                         docker-ce-stable                              33 M
 docker-ce-cli                         x86_64             1:20.10.16-3.el8                                      docker-ce-stable                              29 M
 docker-ce-rootless-extras             x86_64             20.10.16-


With the above command, we added a repository, and Docker is installed. 

Shell
 
[root@docker-flex ~]# sudo dnf install docker-ce
Updating Subscription Management repositories.
Last metadata expiration check: 0:10:28 ago on Wed 25 May 2022 08:27:08 AM EDT.
Package docker-ce-3:19.03.15-3.el8.x86_64 is already installed.
Dependencies resolved.
=====================================================================================================
 Package         Arch   Version                               Repository                        Size
=====================================================================================================
Upgrading:
 docker-ce       x86_64 3:20.10.16-3.el8                      docker-ce-stable                  22 M
Installing dependencies:
 docker-ce-rootless-extras
                 x86_64 20.10.16-3.el8                        docker-ce-stable                 4.7 M
 fuse-overlayfs  x86_64 1.8.2-1.module+el8.6.0+14877+f643d2d6 rhel-8-for-x86_64-appstream-rpms  73 k
 fuse3           x86_64 3.3.0-15.el8                          rhel-8-for-x86_64-baseos-rpms     54 k
 fuse3-libs      x86_64 3.3.0-15.el8                          rhel-8-for-x86_64-baseos-rpms     95 k
 libslirp        x86_64 4.4.0-1.module+el8.6.0+14877+f643d2d6 rhel-8-for-x86_64-appstream-rpms  70 k
 slirp4netns     x86_64 1.1.8-2.module+el8.6.0+14877+f643d2d6 rhel-8-for-x86_64-appstream-rpms  51 k
Transaction Summary
=====================================================================================================
Install  6 Packages
Upgrade  1 Package
Total download size: 27 M


The next step was to enable and start Docker services once the installation was done with success. In addition, we needed to open a few ports in the firewall to allow communication between the MuleSoft repository and server.

Follow the same step as explained MuleSoft document.

  • Download flex-gateway image:
Shell
 
[root@docker-flex ~]# docker pull mulesoft/flex-gateway:1.0.0
1.0.0: Pulling from mulesoft/flex-gateway
ddbb808fb52e: Pull complete
Digest: sha256:b408f563da559d352d32b0ca24d02835d5a8fb18ef6a4b6a1594af6ebe66c82f
Status: Downloaded newer image for mulesoft/flex-gateway:1.0.0
docker.io/mulesoft/flex-gateway:1.0.0
[root@docker-flex ~]# docker images
REPOSITORY              TAG       IMAGE ID       CREATED       SIZE
mulesoft/flex-gateway   1.0.0     4ba042860c8f   3 weeks ago   273MB
[root@docker-flex ~]#

 

  • Register/associate it with the Anypoint Platform using the docker-redhat8 name. 
Shell
 
[root@docker-flex ~]# docker run --entrypoint flexctl -w /registration -v "$(pwd)":/registration mulesoft/flex-gateway:1.0.0 register docker-redhat8 --token=8a61e5c0-3488-433e-add9-7d8e3e96dc39 --organization=464fcf12-56f8-4197-9f27-2fc9a8dde469 --connected=true
Starting registration, please be patient.
Registration completed, the configuration files were written in directory ".".
[root@docker-flex ~]#


Once the above step is executed without error, we will find configuration and certificates which will be generated in the current folder location.

Shell
 
[root@docker-flex ~]# ls -ltrth
total 24K
-rw-------. 1 root root 1.4K May 24 21:45 anaconda-ks.cfg
-rw-r--r--. 1 root root 1.5K May 24 22:00 initial-setup-ks.cfg
-rw-------. 1 root root 6.2K May 25 08:41 6871cac6-fda9-4df9-a81f-51f8036e06a8.pem
-rw-------. 1 root root 1.7K May 25 08:41 6871cac6-fda9-4df9-a81f-51f8036e06a8.key
-rw-------. 1 root root  728 May 25 08:41 6871cac6-fda9-4df9-a81f-51f8036e06a8.conf
[root@docker-flex 


Now, start services to enable flex-gateway on the Anypoint Platform, which can be availed for API configuration.

Shell
 
[root@docker-flex ~]# docker run --rm -v /root/:/etc/flex-gateway/rtm -p 8081:8081 -e FLEX_RTM_ARM_AGENT_CONFIG=/etc/flex-gateway/rtm/6871cac6-fda9-4df9-a81f-51f8036e06a8.conf mulesoft/flex-gateway:1.0.0
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[flex-gateway-agent][info] Running Envoy XDS Service...
[flex-gateway-envoy][info] cds: add 2 cluster(s), remove 2 cluster(s)
[flex-gateway-envoy][info] cds: added/updated 2 cluster(s), skipped 0 unmodified cluster(s)
[flex-gateway-envoy][info] cm init: all clusters initialized
[flex-gateway-envoy][info] all clusters initialized. initializing init manager
[flex-gateway-envoy][info] all dependencies initialized. starting workers


At the same time, we can find the container running as below.

Running Docker Container


In a few seconds, we will see Flex Gateway enabled in the Anypoint Platform as below.

Flex-gateway enabled in the Anypoint Platform

API Manager: Flex Gateway

API associated with registered/active Flex Gateway is as below:

API associated with registered/active Flex Gateway

We can apply policies/create a proxy to protect our API using Flex Gateway along with monitoring API performance.

Apply policies/create a proxy to protect our API using Flex Gateway along with monitoring API performance

Follow these easy steps to set up and use Anypoint Flex Gateway to protect APIs. For more details, please read the document Getting Started with Flex Gateway.

Docker (software) FLEX (protocol)

Opinions expressed by DZone contributors are their own.

Related

  • Docker Model Runner: Streamlining AI Deployment for Developers
  • A Guide to Container Runtimes
  • Gemma 3: Unlocking GenAI Potential Using Docker Model Runner
  • Docker vs Kubernetes: Which to Use and When?

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!