Last active
November 10, 2016 16:32
-
-
Save dbehnke/ff10a3e723c8f28113e64996743bfb76 to your computer and use it in GitHub Desktop.
Go Compiling from Centos6 - useful for if you have cgo and need to compile things from oldest Linux possible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:6 | |
RUN yum -y update && \ | |
yum -y install curl gcc gcc-c++ libaio-devel git && \ | |
yum clean all && \ | |
rm -r -f /var/cache/yum/* | |
COPY getgo.sh /opt/ | |
RUN cd /opt && chmod +x ./getgo.sh && ./getgo.sh && mkdir /usr/local/go | |
RUN groupadd -g 1000 somebody && useradd -m -u 1000 -g 1000 somebody && chown -R somebody:somebody /usr/local/go | |
ENV GOROOT=/opt/go | |
ENV GOPATH=/usr/local/go | |
ENV PATH=/opt/go/bin:/usr/local/go/bin:$PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
baseurl="https://storage.googleapis.com/golang/" | |
curl https://golang.org/dl/ -o index.html && \ | |
dlfile=$(cat index.html | grep "linux-amd64" | grep "download downloadBox" | head -n 1 | awk -F/ '{ print $5 }' | awk -F'"' '{ print $1 }') && \ | |
echo dlfile=${dlfile} | |
curl -vL ${baseurl}${dlfile} -o ${dlfile} && \ | |
tar xvfz ${dlfile} && \ | |
rm *.tar.gz index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment