I have just started learning Go.
This repository contains very basic programs in Go.
Some points to be noted:
- Check for your GOPATH and put your program there only.
- Use
go env
to check you GOPATH. - If you want to run the program from your directory then change the GOPATH to that directory.
Steps to follow:
- Install docker
- Make a Dockerfile for your progam.
- First build the binaries using
sudo docker built -t imagename .
('.' refers your current directory) - To display the images use
sudo docker images
- To display the running containers
sudo docker ps
- To remove the image run
sudo docker image rm imagename
orsudo docker image rm -f imagename
- To stop the container run
sudo docker stop container_id
- Now start container using
sudo docker run -t imagename:latest arg1 arg2 ...
{for example pass http://www.yourwebsite.com as arg1}
- Start container using
sudo docker run -p 8080:8080 imagename:latest