This repository has been archived by the owner on Mar 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from w3c/agt-docker
Agt docker
- Loading branch information
Showing
15 changed files
with
263 additions
and
102 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,60 @@ | ||
# (C) 2023 Volvo Cars | ||
# | ||
# All files and artifacts in the repository at https://github.com/w3c/automotive-vissv2 | ||
# are licensed under the provisions of the license provided by the LICENSE file in this repository. | ||
# To run with redis as state storage use docker compose. This can be used to build individual images but will not | ||
# run. | ||
|
||
ARG GO_VERSION=1.18.3 | ||
ARG VSSTREE_NAME="vss_vissv2.binary" | ||
ARG BUILD_IMAGE="golang:latest" | ||
ARG RUNTIME_IMAGE="debian:bullseye-slim" | ||
|
||
#----------------------Builder----------------------- | ||
FROM ${BUILD_IMAGE} AS builder | ||
ARG VSSTREE_NAME | ||
WORKDIR /build | ||
|
||
#add bin folder to store the compiled files | ||
RUN mkdir bin | ||
|
||
#corporate proxy settings can sometimes cause tls verification error. Add root crt to docker container. | ||
COPY testCredGen/cicso-umbrella/cisco.crt /usr/local/share/ca-certificates/cisco.crt | ||
RUN update-ca-certificates | ||
|
||
#copy the content of the server and utils dir and .mod/.sum files to builder | ||
COPY server/ ./server | ||
COPY grpc_pb/ ./grpc_pb | ||
COPY protobuf/ ./protobuf | ||
COPY utils/ ./utils | ||
COPY go.mod go.sum ./ | ||
|
||
#RUN ls -a etc/ | ||
|
||
#copy cert info from testCredGen to path expected by w3c server | ||
COPY testCredGen/ca transport_sec/ca | ||
COPY testCredGen/server transport_sec/server | ||
COPY testCredGen/client transport_sec/client | ||
|
||
#clean up unused dependencies | ||
#RUN go mod tidy | ||
#compile all projects and place the executables in the bin folder | ||
RUN go build -v -o ./bin ./... | ||
|
||
#----------------------runtime----------------------- | ||
FROM ${RUNTIME_IMAGE} AS runtime | ||
RUN apt-get update && apt-get upgrade -y | ||
RUN apt-get update && apt-get install -y net-tools iproute2 iputils-ping | ||
RUN apt-get autoclean -y | ||
RUN apt-get autoremove -y | ||
COPY --from=builder /build/transport_sec/ ../transport_sec/. | ||
|
||
|
||
FROM golang:1.21-bookworm as agt_server | ||
USER root | ||
RUN mkdir transport_sec | ||
WORKDIR /app | ||
COPY --from=builder /build/bin/agt_server . | ||
COPY --from=builder /build/server/transport_sec/transportSec.json ../transport_sec/transportSec.json | ||
COPY --from=builder /build/server/agt_server/agt_public_key.rsa . | ||
COPY --from=builder /build/server/agt_server/agt_private_key.rsa . |
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
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,16 @@ | ||
**DOCKER** | ||
|
||
**(C) 2023 Volvo Cars**<br> | ||
|
||
Running the Access Grant token server in a docker container. The docker file: *Dockerfile.agtserver* is located in the | ||
project root and the current setup have the agt server to listen on port 7500. | ||
|
||
To build and run the agt docker | ||
container. | ||
``` | ||
cd docker/agt-docker | ||
docker compose -f docker-compose-agt.yml build | ||
docker compose -f docker-compose-agt.yml up | ||
``` | ||
|
||
|
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,14 @@ | ||
version: '3.8' | ||
services: | ||
|
||
agt_server: | ||
container_name: agt_server | ||
build: | ||
context: ../../ # context set to repo root | ||
dockerfile: Dockerfile.agtserver | ||
target: agt_server | ||
entrypoint: [/app/agt_server] | ||
ports: | ||
- "0.0.0.0:7500:7500" | ||
volumes: | ||
- ./logs:/app/logs |
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
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
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
Oops, something went wrong.