forked from open-horizon/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fft-example
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM riscv64/debian:sid-slim | ||
RUN apt-get update && apt-get install -y gawk bc socat curl | ||
COPY *.sh / | ||
WORKDIR / | ||
RUN addgroup --system hzngroup && useradd -g hzngroup hznuser | ||
USER hznuser | ||
EXPOSE 8080 | ||
CMD /start.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Horizon GPS Location Service: gps | ||
# | ||
# This server provides REST access to gps receiver location and satellite data | ||
# (or gps location estimated from the IP address if hardware is not available). | ||
# | ||
# More precise documentation of the behavior of this container may be found | ||
# in the src/main.go source code. | ||
# | ||
# To build this server container, run the following command in this directory: | ||
# $ make | ||
# | ||
# Written by Glen Darling, November 2016. | ||
# Updated to 2-stage build, and modified to target arm32v6, May 2019. | ||
|
||
|
||
|
||
# Build stage 0: Go compilation | ||
|
||
|
||
FROM maiquanghiep/go:1.14.2 | ||
|
||
RUN apt-get update && apt-get install -y git | ||
|
||
RUN mkdir -p /build/bin | ||
COPY src /build/src | ||
|
||
WORKDIR /build | ||
RUN env GOPATH=/build GOOPTIONS_RISCV64='CGO_ENABLED=0 GOOS=linux GOARCH=riscv64' go get github.com/kellydunn/golang-geo | ||
|
||
RUN env GOPATH=/build GOOPTIONS_RISCV64='CGO_ENABLED=0 GOOS=linux GOARCH=riscv64' go build -o /build/bin/riscv64_gps /build/src/main.go | ||
|
||
# Build stage 1: The final container (including armv6_gps binary from above) | ||
|
||
FROM riscv64/debian:sid-slim | ||
|
||
# Install the gpsd daemon, and the certs needed to use https services | ||
RUN apt-get update && apt-get install -y gpsd curl ca-certificates | ||
|
||
# Copy in the server binary from stage 0 of the build (above) | ||
COPY --from=0 /build/bin/riscv64_gps /gps | ||
|
||
# Create hzngroup and hznuser | ||
RUN addgroup --system hzngroup && useradd -g hzngroup hznuser | ||
|
||
# Run container as hznuser user | ||
USER hznuser | ||
|
||
# The gps service uses this port to respond to REST requests | ||
EXPOSE 8080 | ||
|
||
# Set the default command to be the go executable to start everything | ||
CMD /gps |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM carlosedp/busybox:latest | ||
|
||
# Create hzngroup and hznuser | ||
RUN addgroup -S hzngroup && adduser -S hznuser -G hzngroup | ||
|
||
# Run container as hznuser user | ||
USER hznuser | ||
|
||
COPY *.sh / | ||
WORKDIR / | ||
CMD /service.sh |