I tried setting up Go language development environment
目次
- 目次
- abstract
- requirement
- 2.create a Dockerfile
- 3.Docker Build
- 4.Container start-up
- 5.create a sample code
- 6.Running Sample Codes
- 7.Code Build
- deeplearning関連記事
- 参考
スポンサーリンク
abstract
How to setup a Go language development environment using docker
requirement
Jetson Xavier NX
ubuntu18.04
docker
python3.x
2.create a Dockerfile
FROM golang:1.20.0-buster ENV LC_ALL C.UTF-8 ENV LANG C.UTF-8 ARG USERNAME=user ARG GROUPNAME=user ARG UID=1000 ARG GID=1000 RUN groupadd -g $GID $GROUPNAME && \ useradd -m -s /bin/bash -u $UID -g $GID $USERNAME USER $USERNAME WORKDIR /home/$USERNAME/
3.Docker Build
sudo docker build . -t golang
4.Container start-up
sudo docker run -it --rm --runtime nvidia --network host -v path/to/your/workspace:/workspace --name golang golang
5.create a sample code
package main import "fmt" func main() { fmt.Printf("Hello World\n") }
6.Running Sample Codes
go run hello.go
When the following screen appears, you are done.
7.Code Build
You can build and create an executable file with the following command
go build hello.go
An executable file has been created, so let's run it
./hello
When the following screen appears, you are done.
It's easy!!!
スポンサーリンク
deeplearning関連記事
technoxs-stacker.hatenablog.com technoxs-stacker.hatenablog.com technoxs-stacker.hatenablog.com