diff --git a/Dockerfile b/Dockerfile index a454780..ab0f305 100644 --- a/Dockerfile +++ b/Dockerfile @@ -107,7 +107,7 @@ RUN GOPATH=/usr/local/gopkg /bin/bash -c 'for package in \ golang.org/x/tools/cmd/goimports@latest; do \ /usr/local/go/bin/go install "$package"; done' -RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install openjdk-17-jdk +RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install openjdk-17-jdk openjfx RUN wget https://downloads.gradle-dn.com/distributions/gradle-7.4.2-bin.zip -O /tmp/gradle.zip RUN unzip -d /opt/ /tmp/gradle.zip @@ -124,6 +124,10 @@ RUN unzip -d /opt/ /tmp/sonar-scanner.zip RUN rm /tmp/sonar-scanner.zip RUN ln -s /opt/sonar-scanner-4.7.0.2747-linux/bin/sonar-scanner /usr/bin/sonar-scanner +# Protobuf + +RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install protobuf-compiler + ADD . /opt/workspace-repo WORKDIR /opt/workspace-repo RUN /usr/local/go/bin/go build . diff --git a/main.go b/main.go index cfd936b..a4a3cd0 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,7 @@ const usage = `workspace - Use a containerized workspace COMMANDS dump-init-files: Dump emacs/bash init files to home directory, overwriting existing files. - List of files: ~/.bash_aliases, ~/.emacs, ~/.custom.el + List of files: ~/.bash_aliases, ~/.emacs, ~/.custom.el, ~/.gitconfig, ~/.gitignore toggle-nightlight: Toggle Gnome display nightlight feature. ` @@ -55,7 +55,6 @@ func AddUser(username string, uid string) error { } if os.Getenv("WORKSPACE_OS") == "darwin" { - log.Println(fmt.Sprintf("Note: Workspce OS is \"%s\"", os.Getenv("WORKSPACE_OS"))) commandArgs = append(commandArgs, "--create-home") } else { commandArgs = append(commandArgs, "--no-create-home") @@ -96,7 +95,15 @@ func AddGroup(name string, gid string) error { return nil } +const osDarwin = "darwin" +const osLinux = "linux" + func EntryPoint(command []string) error { + hostOS := os.Getenv("WORKSPACE_OS") + if hostOS != osLinux { + log.Println(fmt.Sprintf("Note: Workspce OS is \"%s\"", hostOS)) + } + if len(command) == 0 { command = []string{"/bin/bash", "-i"} }