<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: jerry hopper</title>
    <description>The latest articles on DEV Community by jerry hopper (@jerry_hopper).</description>
    <link>https://dev.to/jerry_hopper</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F250734%2F43d679cf-3b58-4939-90b5-5f19e41f955a.jpg</url>
      <title>DEV Community: jerry hopper</title>
      <link>https://dev.to/jerry_hopper</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jerry_hopper"/>
    <language>en</language>
    <item>
      <title>FusionAuth on Arm64</title>
      <dc:creator>jerry hopper</dc:creator>
      <pubDate>Mon, 15 Jun 2020 20:39:34 +0000</pubDate>
      <link>https://dev.to/jerry_hopper/fusionauth-on-arm64-3emn</link>
      <guid>https://dev.to/jerry_hopper/fusionauth-on-arm64-3emn</guid>
      <description>&lt;p&gt;Since the release of FusionAuth – i’ve been a huge fan! its lightweight, stable and adheres to standards. FusionAuth is by far the best and most complete authentication authorization and user-management system, which gets you real value for your buck.&lt;/p&gt;

&lt;h1&gt;
  
  
  Build for Devs
&lt;/h1&gt;

&lt;p&gt;‘Build for devs’ is one of the unique selling points of FusionAuth identity solution. But what about the hobbyist-developer? Or – what if you would like to develop your application at home, during these corona-times? Is that possible?&lt;/p&gt;

&lt;p&gt;The answer is YES, if you have a server at home that runs linux – You can!&lt;br&gt;
But not every developer has the space for a server or computer that would run the FusionAuth instance at home.&lt;/p&gt;

&lt;p&gt;This is were the Raspberry Pi, NanoPi Neo or any other Arm64 Device can come in very handy. With a price varying from $20 to $90 dollar, you can own such a device – and have your custom development server for at home. Its already been done before , and now we’re going to use our single-board-computer as a full-blown identity solution.&lt;/p&gt;

&lt;p&gt;Since FusionAuth version 1.15 a elastic-search instance is no longer required (but is optional for instances with heavy loads), which is optimal for a tiny fusionauth deployment at home.&lt;/p&gt;
&lt;h1&gt;
  
  
  Docker
&lt;/h1&gt;

&lt;p&gt;To achieve absolute portability, we will be using Docker – which allows us to run applications inside a container – and thus keeping the installation/configuration to a minimum. FusionAuth is already available on Dockerhub, so running it should be a breeze. Lets go!&lt;/p&gt;

&lt;p&gt;Login to your device, and start the fusionauth instance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@arm64docker:~# docker run -p 9011:9011 \
--name fusionauth-app \
fusionauth/fusionauth-app:latest

Unable to find image 'fusionauth/fusionauth-app:latest' locally
latest: Pulling from fusionauth/fusionauth-app
aad63a933944: Pull complete
38dcc57173c1: Pull complete
3c3aac2babe6: Pull complete
1eef9e911159: Pull complete
Digest: sha256:931ec2f08adf562a7f94c62dcf62ba562b41a571318588de231c5c21126b7b2c
Status: Downloaded newer image for fusionauth/fusionauth-app:latest
standard_init_linux.go:211: exec user process caused "exec format error"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;As you can see, the process exits with the following error message : standard_init_linux.go:211: exec user process caused “exec format error”.&lt;/p&gt;

&lt;p&gt;So, what’s going on? This error tells us that the application you wanted to start, was build for a different architecture. If we check dockerhub, and view the FusionAuth tags you will notice the Docker containers are build for Linux/amd64. When we check our SBC’s platform by typing the command uname -a the result will be a different platform then amd64&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@arm64docker:~# uname -a
Linux arm64docker 5.4.43-sunxi64 #20.05.2 SMP Tue Jun 2 17:20:17 CEST 2020 aarch64 GNU/Linux 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  FusionAuth’s Dockerfile
&lt;/h1&gt;

&lt;p&gt;We can conclude that FusionAuth is not Arm64 compatible…. But is that really true? FusionAuth is a Java application, and Java can run on Arm64 devices – so in theory it could work!&lt;/p&gt;

&lt;p&gt;If we look at fusionAuth’s Dockerfile we can see how the container is build.&lt;br&gt;
&lt;a href="https://hub.docker.com/r/fusionauth/fusionauth-app"&gt;https://hub.docker.com/r/fusionauth/fusionauth-app&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM alpine:latest as build

###### Install stuff we need and then cleanup cache #################
RUN apk add --no-cache \
  unzip \
  curl

###### Get and install FusionAuth App Bundle ########################
ENV FUSIONAUTH_VERSION=1.17.1
RUN curl -Sk --progress-bar https://storage.googleapis.com/inversoft_products_j098230498/products/fusionauth/${FUSIONAUTH_VERSION}/fusionauth-app-${FUSIONAUTH_VERSION}.zip -o fusionauth-app.zip \
  &amp;amp;&amp;amp; mkdir -p /usr/local/fusionauth/fusionauth-app \
  &amp;amp;&amp;amp; unzip -nq fusionauth-app.zip -d /usr/local/fusionauth

FROM fusionauth/fusionauth-java:14-jdk-alpine3.11.5

RUN addgroup fusionauth \
  &amp;amp;&amp;amp; adduser -G fusionauth -D -H fusionauth

COPY --chown=fusionauth:fusionauth --from=build /usr/local/fusionauth /usr/local/fusionauth

###### Start FusionAuth App #########################################
LABEL description="Create an image running FusionAuth App. Installs FusionAuth App"
LABEL maintainer="FusionAuth &amp;lt;dev@fusionauth.io&amp;gt;"
EXPOSE 9011
USER fusionauth
ENV FUSIONAUTH_USE_GLOBAL_JAVA=1
CMD ["/usr/local/fusionauth/fusionauth-app/apache-tomcat/bin/catalina.sh", "run"]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If we breakdown what happens here, its :&lt;br&gt;
– Download and unzip the FusionAuth application,&lt;br&gt;
– Import Java,&lt;br&gt;
– Add a FusionAuth&lt;br&gt;
Notice that FusionAuth docker images are based on Alpine, and uses java Version 14&lt;/p&gt;
&lt;h1&gt;
  
  
  The Arm64 Dockerfile
&lt;/h1&gt;

&lt;p&gt;Before we begin, its good to know that Alpine doesnt use Glibc – but musl. As there is no musl-compatible jdkv14, and installing Glibc on Alpine is not part of this tutorial, we will be using the (much larger) ubuntu Java image.&lt;/p&gt;

&lt;p&gt;We create a Dockerfile, where we specify the V14 jdk container from adoptopenjdk We pull in the FusionAuth zip – like in the official Dockerfile. We add the user, and that’s it. See the below Dockerfile for details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM adoptopenjdk:14-jdk-hotspot-bionic as build

###### Install stuff we need and then cleanup cache #################
RUN apt update &amp;amp;&amp;amp; apt install unzip

###### Get and install FusionAuth App Bundle ########################
ENV FUSIONAUTH_VERSION=1.17.0
RUN curl -Sk --progress-bar https://storage.googleapis.com/inversoft_products_j098230498/products/fusionauth/${FUSIONAUTH_VERSION}/fusionauth-app-${FUSIONAUTH_VERSION}.zip -o fusionauth-app.zip \
  &amp;amp;&amp;amp; mkdir -p /usr/local/fusionauth/fusionauth-app \
  &amp;amp;&amp;amp; unzip -nq fusionauth-app.zip -d /usr/local/fusionauth


FROM adoptopenjdk:14-jdk-hotspot-bionic


#RUN addgroup fusionauth &amp;amp;&amp;amp; adduser -G fusionauth -D -H fusionauth
RUN groupadd fusionauth
RUN useradd -r -s /bin/sh -g fusionauth -u 1001 fusionauth


# copy FusionAuth from other image.
COPY --chown=fusionauth:fusionauth --from=build /usr/local/fusionauth /usr/local/fusionauth

###### Start FusionAuth App #########################################
LABEL description="Create an image running FusionAuth App. Installs FusionAuth App"
LABEL maintainer="FusionAuth-community &amp;lt;hopper.jerry@gmail.com&amp;gt;"
EXPOSE 9011
USER fusionauth
ENV FUSIONAUTH_USE_GLOBAL_JAVA=1
CMD ["/usr/local/fusionauth/fusionauth-app/apache-tomcat/bin/catalina.sh", "run"]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We can now build the docker container, and use it on a Arm64 device. So, whether you run it on a Raspberry Pi, NanoPi , Jetson or any other sbc-device – your personal idp is ready for any development-task you are about to face, like running automated tests against a real oAuth2 server!&lt;/p&gt;

&lt;p&gt;Another possibility, is to run your FusionAuth server on AWS Arm64 cloudplatform, if you prefer low-energy-footprint servers.&lt;/p&gt;

&lt;p&gt;Have a look at the cool new Kickstart functionality to quikly deploy your identity management solution, and start developing your apps at home like a boss!&lt;/p&gt;

&lt;h1&gt;
  
  
  Community Arm64 build
&lt;/h1&gt;

&lt;p&gt;But, if all of this is just a little too much for you, you can also download my prebuild Arm64 container on dockerhub &lt;br&gt;
&lt;a href="https://hub.docker.com/repository/docker/botnyx/fusionauth-app-aarch64"&gt;https://hub.docker.com/repository/docker/botnyx/fusionauth-app-aarch64&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run \
    -p 9011:9011 \
    --name fusionauth-app \
    botnyx/fusionauth-app-aarch64:latest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Please keep in mind this arm64 image is not official, nor is it officially supported!&lt;/p&gt;

&lt;p&gt;For more information about FusionAuth, visit : &lt;a href="http://FusionAuth.io"&gt;http://FusionAuth.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thats it, Happy developing!&lt;/p&gt;

&lt;p&gt;This article was posted on my blog : &lt;a href="https://blog.jerryhopper.com/2020/06/15/fusionauth-on-arm64/"&gt;https://blog.jerryhopper.com/2020/06/15/fusionauth-on-arm64/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>arm64</category>
      <category>identity</category>
      <category>authorisation</category>
    </item>
  </channel>
</rss>
