Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker config selfadaptive #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dockerfile
run-docker
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Define go base image and version
FROM golang:1.20.3-alpine

# Install g++ dependency (for plugin build)
RUN apk --update add g++

# Define GOROOT variable
ENV GOROOT=/usr/local/go

# Copy project files to container
COPY . /go/selfadaptive

# Change base path
WORKDIR /go/selfadaptive
17 changes: 17 additions & 0 deletions run-docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Creates docker image
# -t => [tag image] (name:tag)
# . => context of build (current directory dot)
docker build -t selfadaptive:latest .

# Executes docker container (The container is an instance of an image)
# --rm => when stoped the container will be removed (but the container image remains)
# -it => 'binds' iterative shell to container terminal
docker run --rm -it selfadaptive:latest sh



# Go Build Plugin
# -buildmode=plugin

4 changes: 2 additions & 2 deletions shared/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ const NumberOfColors = 7
const ColorReset = "\033[0m"

// Base Directories
const SourcesDir = "/Volumes/GoogleDrive/Meu Drive/go/selfadaptive/example-plugin/envrnment/plugins/source"
const ExecutablesDir = "/Volumes/GoogleDrive/Meu Drive/go/selfadaptive/example-plugin/envrnment/plugins/executable"
const SourcesDir = "/go/selfadaptive/example-plugin/envrnment/plugins/source"
const ExecutablesDir = "/go/selfadaptive/example-plugin/envrnment/plugins/executable"

//const SourcesDir = "C:\\Users\\user\\go\\selfadaptive\\example-plugin\\envrnment\\sources"
//const ExecutablesDir = "C:\\Users\\user\\go\\selfadaptive\\example-plugin\\envrnment\\executables"
Expand Down