From 7c5be73c717afb8a59abd34d5f854705bf82079b Mon Sep 17 00:00:00 2001 From: sneak Date: Thu, 8 Dec 2022 22:30:14 +0400 Subject: [PATCH] cleanup for modcache --- Dockerfile | 7 +++---- Makefile | 2 +- setup.sh | 17 ++++++----------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2e84be8..14c4106 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,8 @@ FROM debian:bullseye-20221205 ENV DEBIAN_FRONTEND noninteractive ENV NVM_DIR /usr/local/nvm ENV GOROOT /usr/local/go -ENV PATH $PATH:/usr/local/go/bin:/root/go/bin +ENV GOPATH /root/go +ENV PATH $PATH:$GOROOT/bin:$GOPATH/bin:$NVM_DIR/versions/node/v18.12.1/bin RUN --mount=type=cache,target=/var/cache/apt \ apt update && apt install -y \ @@ -33,9 +34,7 @@ RUN rm -rf /usr/local/go && \ tar -C /usr/local -xzf go*.linux-$(uname -m).tar.gz && \ echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile -RUN go version - -RUN mkdir -p "$(go env GOMODCACHE)" && cd $(go env GOMODCACHE)/../ && tar xvf /tmp/modcache.tar && rm /tmp/modcache.tar && cd /tmp +RUN mkdir -p "$(go env GOMODCACHE)" && cd $(go env GOMODCACHE) && tar xvf /tmp/modcache.tar && rm /tmp/modcache.tar && cd /tmp RUN \ go install -v google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 && \ diff --git a/Makefile b/Makefile index 77d0323..3fc842b 100644 --- a/Makefile +++ b/Makefile @@ -44,4 +44,4 @@ push: docker push $(RN):$(shell git branch --show-current) deps/modcache.tar: - cd $(shell go env GOMODCACHE)/../ && tar -c . | pv > $(PWD)/deps/modcache.tar + cd $(shell go env GOMODCACHE)/ && tar -c . | pv > $(PWD)/deps/modcache.tar diff --git a/setup.sh b/setup.sh index a1202e3..c327ef3 100644 --- a/setup.sh +++ b/setup.sh @@ -1,29 +1,24 @@ #!/bin/bash ################################################################################ -#2345678911234567892123456789312345678941234567895123456789612345678971234567898 +## that's a hell of an act. what do you call it? "JAVASCRIPT" ################################################################################ -cd /tmp - mkdir -p "$NVM_DIR" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash echo "export NVM_DIR=$NVM_DIR" >> /etc/profile echo "source \$NVM_DIR/nvm.sh" >> /etc/profile - source /etc/profile -NCD="/usr/local/nvm/.cache/bin/node-v18.12.1-linux-arm64/" +CD="/usr/local/nvm/.cache/bin/node-v18.12.1-linux-arm64/" mkdir -p "$NCD" mv /tmp/node-v18.12.1-linux-arm64.tar.xz "$NCD" nvm ls-remote nvm install v18.12.1 nvm use v18.12.1 +npm install -g npm@9.2.0 npm install -g yarn yarn global add prettier - -prettier --version - -which npm -which yarn - +################################################################################ +## cleanup +################################################################################ rm -rf /usr/local/nvm/.cache /tmp/*