cleanup for modcache

This commit is contained in:
Jeffrey Paul 2022-12-08 22:30:14 +04:00
parent 14e59af354
commit 7c5be73c71
3 changed files with 10 additions and 16 deletions

View File

@ -5,7 +5,8 @@ FROM debian:bullseye-20221205
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
ENV NVM_DIR /usr/local/nvm ENV NVM_DIR /usr/local/nvm
ENV GOROOT /usr/local/go 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 \ RUN --mount=type=cache,target=/var/cache/apt \
apt update && apt install -y \ 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 && \ tar -C /usr/local -xzf go*.linux-$(uname -m).tar.gz && \
echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile 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 \ RUN \
go install -v google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 && \ go install -v google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 && \

View File

@ -44,4 +44,4 @@ push:
docker push $(RN):$(shell git branch --show-current) docker push $(RN):$(shell git branch --show-current)
deps/modcache.tar: 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

View File

@ -1,29 +1,24 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
#2345678911234567892123456789312345678941234567895123456789612345678971234567898 ## that's a hell of an act. what do you call it? "JAVASCRIPT"
################################################################################ ################################################################################
cd /tmp
mkdir -p "$NVM_DIR" mkdir -p "$NVM_DIR"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
echo "export NVM_DIR=$NVM_DIR" >> /etc/profile echo "export NVM_DIR=$NVM_DIR" >> /etc/profile
echo "source \$NVM_DIR/nvm.sh" >> /etc/profile echo "source \$NVM_DIR/nvm.sh" >> /etc/profile
source /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" mkdir -p "$NCD"
mv /tmp/node-v18.12.1-linux-arm64.tar.xz "$NCD" mv /tmp/node-v18.12.1-linux-arm64.tar.xz "$NCD"
nvm ls-remote nvm ls-remote
nvm install v18.12.1 nvm install v18.12.1
nvm use v18.12.1 nvm use v18.12.1
npm install -g npm@9.2.0
npm install -g yarn npm install -g yarn
yarn global add prettier yarn global add prettier
################################################################################
prettier --version ## cleanup
################################################################################
which npm
which yarn
rm -rf /usr/local/nvm/.cache /tmp/* rm -rf /usr/local/nvm/.cache /tmp/*