-
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.
- Loading branch information
Showing
6 changed files
with
78 additions
and
1 deletion.
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,5 @@ | ||
*/.github* | ||
*.md | ||
*/example* | ||
Dockerfile | ||
.dockerignore |
Empty file.
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
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,36 @@ | ||
FROM golang:1.21-alpine AS build | ||
|
||
|
||
WORKDIR /go/src/app | ||
COPY ./ ./ | ||
RUN go get -d -v ./... | ||
RUN go build -v . | ||
|
||
FROM ubuntu | ||
|
||
ENV COUNTRY="DE" | ||
ENV STATE="Saxony" | ||
ENV LOCALITY="Dresden" | ||
ENV ORGANIZATION="FIWARE Foundation e.V." | ||
ENV COMMON_NAME="www.fiware.org" | ||
ENV STORE_PASS="myPassword" | ||
ENV KEY_ALIAS="myAlias" | ||
|
||
|
||
RUN apt-get update | ||
RUN apt-get install openssl -yq | ||
RUN apt-get install wget -yq | ||
|
||
RUN mkdir /cert | ||
RUN mkdir /did-helper | ||
RUN chmod a+rw /cert | ||
RUN chmod a+rw /did-helper | ||
|
||
WORKDIR /did-helper | ||
|
||
COPY --from=build /go/src/app/did-helper ./did-helper | ||
COPY --from=build /go/src/app/docker/entrypoint.sh /temp/entrypoint.sh | ||
|
||
RUN chmod a+x /temp/entrypoint.sh | ||
USER 1000 | ||
ENTRYPOINT ["/temp/entrypoint.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
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 @@ | ||
#!/bin/bash | ||
|
||
cd /cert | ||
|
||
openssl ecparam -name prime256v1 -genkey -noout -out private-key.pem | ||
openssl ec -in private-key.pem -pubout -out public-key.pem | ||
openssl req -new -x509 -key private-key.pem -out cert.pem -days 360 -subj "/C=${COUNTRY}/ST=${STATE}/L=${LOCALITY}/O=${ORGANIZATION}/CN=${COMMON_NAME}" | ||
openssl pkcs12 -export -inkey private-key.pem -in cert.pem -out cert.pfx -name ${KEY_ALIAS} -password pass:${STORE_PASS} | ||
|
||
cd /temp | ||
/did-helper/did-helper -keystorePath /cert/cert.pfx -keystorePassword=${STORE_PASS} -outputFile /cert/did.json |