Last active
December 7, 2018 11:02
-
-
Save mreferre/fba27cc8efb16d7a1ffb3a5f5c0f1d91 to your computer and use it in GitHub Desktop.
Dockerfile for building a Greengrass 1.7 image for arm64
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
FROM amazonlinux:2 | |
MAINTAINER [email protected] | |
# This Dockerfile builds a GG image for the ARM64 platform | |
# curl this file: https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/1.7.0/aws-greengrass-docker-1.7.0.tar.gz | |
# untar it | |
# move into the directory | |
# curl this file: https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/1.7.0/greengrass-linux-aarch64-1.7.0.tar.gz | |
# replace the Dockerfile in the directory with this Dockerfile | |
# run this command: docker build -t gg-arm64:1.7 --build-arg "greengrass_release=greengrass-linux-aarch64-1.7.0.tar.gz" . | |
# follow the steps documented here: https://docs.aws.amazon.com/greengrass/latest/developerguide/run-gg-in-docker-container.html | |
# Set ENV_VAR for Greengrass RC to be untarred inside Docker Image | |
ARG greengrass_release | |
ENV GREENGRASS_RELEASE=${greengrass_release} | |
# Install Greengrass Core Dependencies | |
RUN yum update -y && \ | |
yum install -y shadow-utils tar gzip xz wget java-1.8.0 && \ | |
wget https://nodejs.org/dist/v6.10.2/node-v6.10.2-linux-arm64.tar.xz && \ | |
tar xf node-v6.10.2-linux-arm64.tar.xz && \ | |
cp node-v6.10.2-linux-arm64/bin/node /usr/bin/node && \ | |
ln -s /usr/bin/node /usr/bin/nodejs6.10 && \ | |
rm -rf node-v6.10.2-linux-arm64.tar.xz node-v6.10.2-linux-arm64 && \ | |
yum remove -y wget | |
# Copy Greengrass Licenses AWS IoT Greengrass Docker Image | |
COPY greengrass-license-v1.pdf / | |
# Create ggc_user and ggc_group | |
RUN useradd -r ggc_user | |
RUN groupadd -r ggc_group | |
# Copy/Untar Greengrass RC inside Docker Image | |
COPY $greengrass_release / | |
RUN tar xzf /$GREENGRASS_RELEASE -C / | |
RUN rm /$GREENGRASS_RELEASE | |
# Copy start-up script | |
COPY "greengrass-entrypoint.sh" / | |
# Expose 8883 to pub/sub MQTT messages | |
EXPOSE 8883 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment