Add container for server work

This commit is contained in:
Michael Hohn
2024-05-31 13:26:24 -07:00
committed by =Michael Hohn
parent c6ebfcc4c4
commit 776b980d3b
2 changed files with 38 additions and 3 deletions

View File

@@ -2,6 +2,27 @@
TODO diagram
TODO note: NO package init() functions
Dynamic behaviour must be explicit
TODO Style notes
- NO package init() functions
- Dynamic behaviour must be explicit
## cross-compile server on host, run it in container
1. build server on host
GOOS=linux GOARCH=arm64 go build
2. build docker image
docker build -t server-image .
3. Start container with shared directory
```sh
docker run -it \
-v /Users/hohn/work-gh/mrva/mrvacommander:/mrva/mrvacommander \
server-image
```
4. Run server in container
cd /mrva/mrvacommander/cmd/server/ && ./server

14
cmd/server/Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
# Use Ubuntu 22.04 as the base image
FROM arm64v8/ubuntu:22.04
# Set environment variables to non-interactive to avoid prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Update the package list
RUN apt-get update && \
apt-get clean
RUN mkdir /mrva
# Set the default command
CMD ["bash"]