# Build environment image # Do the following to build and run: # docker build -t bld-centos-7 . # Once image is built, you can run it: # docker run -it bld-centos-7 /bin/bash # The same, but with mounted 'proj' folder: # docker run -it --mount type=bind,source="$(pwd)"/proj,target=/proj bld-centos-7 /bin/bash # The same, also initializes systemd and maps gopath's src into /goproj/src: # docker run -d -e=container=docker --stop-signal=SIGRTMIN+3 --cap-add=SYS_ADMIN --security-opt=seccomp:unconfined -v /sys/fs/cgroup:/sys/fs/cgroup:ro --mount type=bind,source=$GOPATH/src,target=/goproj/src bld-centos-7 /sbin/init FROM centos:7 RUN echo "Install build environment software..." RUN yum install -y screen tcpdump make # RPM development RUN yum install -y rpmdevtools rpm-build RUN yum clean all # Install Go 1.10 RUN curl -s https://dl.google.com/go/go1.10.linux-amd64.tar.gz > /go1.10.linux-amd64.tar.gz RUN tar xfz /go1.10.linux-amd64.tar.gz RUN mv /go /opt/go RUN rm /go1.10.linux-amd64.tar.gz # Set go dir ENV GOROOT /opt/go RUN mkdir /goproj ENV GOPATH /goproj # Set up system-wide PATH variables in the global profile RUN echo 'export PATH=$PATH:/opt/go/bin' > /etc/profile.d/go.sh RUN echo "Installation completed"