Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • beornf/discourse
1 result
Show changes
Commits on Source (45)
variables:
GIT_SUBMODULE_STRATEGY: recursive
DOCKER_HUB_REPO: libresh/discourse
.compute_version: &compute_version
- if [ "$CHANNEL" == "stable" ]; then export FILTER="grep -v beta"; else export FILTER="grep beta"; fi
- export DISCOURSE_VERSION=`wget -qO- https://api.github.com/repos/discourse/discourse/tags | grep name | cut -d'"' -f4 | $FILTER | head -n1`
- export DATE=`date "+%Y-%m-%dT%H-%M-%SZ"`
.test:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
variables:
DESTINATION: "--no-push"
script:
- *compute_version
- export DISCOURSE_MAJOR=`echo $DISCOURSE_VERSION | cut -d"." -f1-3`
- echo $DISCOURSE_MAJOR
- echo $DISCOURSE_VERSION
- /kaniko/executor --single-snapshot --context . ${DESTINATION} --build-arg DISCOURSE_VERSION=$DISCOURSE_VERSION
except:
- master
test-beta:
extends: .test
variables:
CHANNEL: "beta"
test-stable:
extends: .test
variables:
CHANNEL: "stable"
.push:
extends: .test
before_script:
- *compute_version
- cp $DOCKER_SECRET_CONFIG /kaniko/.docker/config.json
- export DESTINATION="--destination ${DOCKER_HUB_REPO}:${DISCOURSE_VERSION}-${DATE} --destination ${DOCKER_HUB_REPO}:${DISCOURSE_VERSION} --destination ${DOCKER_HUB_REPO}:${DISCOURSE_MAJOR} --destination ${DOCKER_HUB_REPO}:${CHANNEL}"
except: []
only:
- master
# bug: the CHANNEL variable is not passed to the Dockerfile.
push-beta:
extends: .push
variables:
CHANNEL: "beta"
#push-stable:
# extends: .push
# variables:
# CHANNEL: "stable"
[submodule "install/discourse-akismet"]
path = install/discourse-akismet
url = https://github.com/discourse/discourse-akismet
[submodule "install/discourse-assign"]
path = install/discourse-assign
url = https://github.com/discourse/discourse-assign
[submodule "install/discourse-calendar"]
path = install/discourse-calendar
url = https://github.com/discourse/discourse-calendar
[submodule "install/discourse-docs"]
path = install/discourse-docs
url = https://github.com/discourse/discourse-docs
[submodule "install/discourse-encrypt"]
path = install/discourse-encrypt
url = https://github.com/discourse/discourse-encrypt
[submodule "install/discourse-locations"]
path = install/discourse-locations
url = https://github.com/paviliondev/discourse-locations
[submodule "install/discourse-legal-tools"]
path = install/discourse-legal-tools
url = https://github.com/paviliondev/discourse-legal-tools
[submodule "install/discourse-math"]
path = install/discourse-math
url = https://github.com/discourse/discourse-math
[submodule "install/discourse-openid-connect"]
path = install/discourse-openid-connect
url = https://github.com/discourse/discourse-openid-connect
[submodule "install/discourse-solved"]
path = install/discourse-solved
url = https://github.com/discourse/discourse-solved
[submodule "install/discourse-topic-voting"]
path = install/discourse-topic-voting
url = https://github.com/discourse/discourse-topic-voting
[submodule "install/discourse-air"]
path = install/discourse-air
url = https://github.com/discourse/discourse-air
[submodule "install/discourse-reactions"]
path = install/discourse-reactions
url = https://github.com/discourse/discourse-reactions
[submodule "install/discourse-templates"]
path = install/discourse-templates
url = https://github.com/discourse/discourse-templates
[submodule "install/discourse-docs-card-filter"]
path = install/discourse-docs-card-filter
url = https://github.com/discourse/discourse-docs-card-filter
[submodule "install/discourse-events"]
path = install/discourse-events
url = https://github.com/paviliondev/discourse-events
FROM ruby:2.5.3 FROM golang:1.22 as refresh-assets
WORKDIR /app
ENV RAILS_ENV=production \ COPY refresh-assets/go.mod refresh-assets/go.sum ./
DISCOURSE_DB_HOST=postgres \ RUN go mod download
DISCOURSE_REDIS_HOST=redis \ COPY refresh-assets/*.go ./
DISCOURSE_SERVE_STATIC_ASSETS=true \ RUN CGO_ENABLED=0 GOOS=linux go build -o /refresh-assets
GIFSICLE_VERSION=1.91 \
PNGQUANT_VERSION=2.12.1 \ FROM debian:bullseye-slim
PNGCRUSH_VERSION=1.8.13 \
DISCOURSE_VERSION=2.2.0.beta4 \ # slim https://github.com/discourse/discourse_docker/blob/main/image/base/slim.Dockerfile#L5
PG_MAJOR=10 \ ENV RUBY_ALLOCATOR=/usr/lib/libjemalloc.so.1 \
BUILD_DEPS="\ RUSTUP_HOME=/usr/local/rustup \
autoconf \ CARGO_HOME=/usr/local/cargo \
advancecomp \ PATH=/usr/local/cargo/bin:$PATH \
libbz2-dev \ LEFTHOOK=0
libfreetype6-dev \ # release https://github.com/discourse/discourse_docker/blob/main/image/base/release.Dockerfile#L6
libjpeg-dev \ ENV RAILS_ENV=production
libjpeg-turbo-progs \ # web template https://github.com/discourse/discourse_docker/blob/main/templates/web.template.yml#L1
libtiff-dev \ ENV DISCOURSE_SERVE_STATIC_ASSETS=true \
pkg-config" SKIP_EMBER_CLI_COMPILE=1 \
RUBY_GC_HEAP_GROWTH_MAX_SLOTS=40000 \
RUN curl http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add - RUBY_GC_HEAP_INIT_SLOTS=400000 \
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" | \ RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.5
tee /etc/apt/sources.list.d/postgres.list
#LABEL maintainer="Sam Saffron \"https://twitter.com/samsaffron\""
RUN curl --silent --location https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get update && apt-get install -y --no-install-recommends \ RUN echo 'deb http://deb.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/bullseye-backports.list
${BUILD_DEPS} \ RUN echo "debconf debconf/frontend select Teletype" | debconf-set-selections
brotli \ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install gnupg sudo curl
ghostscript \
gsfonts \ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y locales locales-all
imagemagick \ ENV LC_ALL en_US.UTF-8
jpegoptim \ ENV LANG en_US.UTF-8
libxml2 \ ENV LANGUAGE en_US.UTF-8
nodejs \
optipng \ RUN curl --silent --location https://deb.nodesource.com/setup_18.x | sudo bash -
jhead \ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
postgresql-client-${PG_MAJOR} \ RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
postgresql-contrib-${PG_MAJOR} libpq-dev libreadline-dev RUN apt-get -y update
# install these without recommends to avoid pulling in e.g.
RUN npm install svgo uglify-js@"<3" -g # X11 libraries, mailutils
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends git jq
RUN mkdir /jemalloc-stable && cd /jemalloc-stable &&\ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install autoconf build-essential ca-certificates \
wget https://github.com/jemalloc/jemalloc/releases/download/3.6.0/jemalloc-3.6.0.tar.bz2 &&\ libxslt-dev libcurl4-openssl-dev \
tar -xjf jemalloc-3.6.0.tar.bz2 && cd jemalloc-3.6.0 && ./configure --prefix=/usr && make && make install &&\ libssl-dev libyaml-dev libtool \
cd / && rm -rf /jemalloc-stable libpcre3 libpcre3-dev zlib1g zlib1g-dev \
libxml2-dev gawk \
RUN mkdir /jemalloc-new && cd /jemalloc-new &&\ libreadline-dev libpq-dev \
wget https://github.com/jemalloc/jemalloc/releases/download/5.1.0/jemalloc-5.1.0.tar.bz2 &&\ psmisc whois brotli libunwind-dev \
tar -xjf jemalloc-5.1.0.tar.bz2 && cd jemalloc-5.1.0 && ./configure --prefix=/usr --with-install-suffix=5.1.0 && make build_lib && make install_lib &&\ libtcmalloc-minimal4 cmake \
cd / && rm -rf /jemalloc-new pngcrush pngquant ripgrep
RUN cd / &&\
RUN gem update --system apt-get clean &&\
locale-gen en_US &&\
RUN gem install bundler --force \ DEBIAN_FRONTEND=noninteractive apt-get install -y wget nodejs yarn &&\
&& rm -rf /usr/local/share/ri/2.5.2/system npm install -g terser uglify-js pnpm
ADD install-imagemagick /tmp/install-imagemagick ADD install-imagemagick /tmp/install-imagemagick
RUN /tmp/install-imagemagick RUN /tmp/install-imagemagick
# Validate install ADD install-jemalloc /tmp/install-jemalloc
RUN ruby -Eutf-8 -e "v = \`convert -version\`; %w{png tiff jpeg freetype}.each { |f| unless v.include?(f); STDERR.puts('no ' + f + ' support in imagemagick'); exit(-1); end }" RUN /tmp/install-jemalloc
ADD install-pngcrush /tmp/install-pngcrush ADD install-rust /tmp/install-rust
RUN /tmp/install-pngcrush ADD install-ruby /tmp/install-ruby
ADD install-oxipng /tmp/install-oxipng
ADD install-gifsicle /tmp/install-gifsicle RUN /tmp/install-rust && /tmp/install-ruby && /tmp/install-oxipng && rustup self uninstall -y
RUN /tmp/install-gifsicle
RUN echo 'gem: --no-document' >> /usr/local/etc/gemrc &&\
ADD install-pngquant /tmp/install-pngquant gem update --system
RUN /tmp/install-pngquant
# This tool allows us to disable huge page support for our current process
# since the flag is preserved through forks and execs it can be used on any
# process
ADD thpoff.c /src/thpoff.c
RUN gcc -o /usr/local/sbin/thpoff /src/thpoff.c && rm /src/thpoff.c
# clean up for docker squash
RUN rm -fr /usr/share/man &&\
rm -fr /usr/share/doc &&\
rm -fr /usr/share/vim/vim74/doc &&\
rm -fr /usr/share/vim/vim74/lang &&\
rm -fr /usr/share/vim/vim74/spell/en* &&\
rm -fr /usr/share/vim/vim74/tutor &&\
rm -fr /usr/local/share/doc &&\
rm -fr /usr/local/share/ri &&\
rm -fr /usr/local/share/ruby-build &&\
rm -fr /var/lib/apt/lists/* &&\
rm -fr /root/.gem &&\
rm -fr /root/.npm &&\
rm -fr /tmp/*
# this can probably be done, but I worry that people changing PG locales will have issues
# cd /usr/share/locale && rm -fr `ls -d */ | grep -v en`
# this is required for aarch64 which uses buildx
# see https://github.com/docker/buildx/issues/150
RUN rm -f /etc/service
ARG DISCOURSE_VERSION
# Discourse specific bits
RUN useradd discourse -s /bin/bash -m -U &&\
install -dm 0755 -o discourse -g discourse /var/www/discourse &&\
sudo -u discourse curl -s -L https://github.com/discourse/discourse/archive/refs/tags/${DISCOURSE_VERSION}.tar.gz | tar xvz -C /var/www/discourse --strip-components 1 &&\
gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' /var/www/discourse/Gemfile.lock) &&\
chown -R discourse:discourse /var/www/discourse
RUN addgroup --gid 1000 discourse \ USER discourse
&& adduser --system --uid 1000 --ingroup discourse --shell /bin/bash discourse \ WORKDIR /var/www/discourse
&& cd /home/discourse \
&& mkdir -p tmp/pids \
&& mkdir -p ./tmp/sockets \
&& git clone --branch v${DISCOURSE_VERSION} https://github.com/discourse/discourse.git \
&& chown -R discourse:discourse . \
&& cd /home/discourse/discourse \
&& git remote set-branches --add origin tests-passed \
&& sed -i 's/daemonize true/daemonize false/g' ./config/puma.rb \
&& bundle config build.nokogiri --use-system-libraries \
&& bundle install --deployment --verbose --without test --without development --retry 3 --jobs 4
RUN find /home/discourse/discourse/vendor/bundle -name tmp -type d -exec rm -rf {} + RUN bundle config --local deployment true &&\
bundle config --local path ./vendor/bundle &&\
bundle config --local without test development &&\
bundle config --local jobs 4 && \
bundle install &&\
yarn install --frozen-lockfile &&\
yarn cache clean &&\
find /var/www/discourse/vendor/bundle -name tmp -type d -exec rm -rf {} +
# RUN apt-get remove -y --purge ${BUILD_DEPS} \ COPY --chown=1000:1000 install/ /var/www/discourse/plugins/
# && apt-get autoremove -y \
# && rm -rf /var/lib/apt/lists/*
RUN rm -rf /var/lib/apt/lists/* RUN cd app/assets/javascripts/discourse && \
/var/www/discourse/app/assets/javascripts/node_modules/.bin/ember build -prod
WORKDIR /home/discourse/discourse
ENV RAILS_ENV=production \ COPY --chown=1000:1000 app.sh .
RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 \ COPY --chown=1000:1000 sidekiq.sh .
RUBY_GC_HEAP_GROWTH_MAX_SLOTS=40000 \ COPY --chown=1000:1000 upgrade.sh .
RUBY_GC_HEAP_INIT_SLOTS=400000 \ COPY --chown=1000:1000 --from=refresh-assets /refresh-assets .
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.5 \
RUBY_GC_MALLOC_LIMIT=90000000
USER discourse
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"] CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
\ No newline at end of file
VERSION=$(shell cat VERSION)
TAG?=${VERSION}
all: update build push
update:
python3 scripts/discourse-plugins.py ${VERSION}
build:
sudo podman build -t quay.io/libre.sh/discourse:${TAG} --build-arg DISCOURSE_VERSION=${VERSION} .
push:
sudo podman push quay.io/libre.sh/discourse:${TAG}
\ No newline at end of file
# docker-discourse # docker-discourse
discourse image for discourse service Discourse image for discourse service
It is based on [upstream discourse image](https://hub.docker.com/r/discourse/base/)
## Discourse plugins ## Discourse plugins
This image supports installing Discourse plugins at build time, via the `DISCOURSE_ADDITIONAL_PLUGINS` [build arg](https://docs.docker.com/engine/reference/builder/#/arg). Set it to a whitespace (space, tab, newline) separated list if valid `git` URLs of plugins to be installed at build time. This image supports installing Discourse plugins at build time, via the `install/plugin-list` file. It lists`git` URLs of plugins to be installed at build time.
\ No newline at end of file \ No newline at end of file
v3.2.2
\ No newline at end of file
#!/bin/bash
set -euxo pipefail
bundle exec rake assets:precompile:theme_transpiler
exec bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb
\ No newline at end of file
#!/bin/bash
set -e
VERSION=1.91
cd /tmp
curl -O http://www.lcdf.org/gifsicle/gifsicle-$VERSION.tar.gz
tar zxf gifsicle-$VERSION.tar.gz
cd gifsicle-$VERSION
./configure
make install
cd /
rm -fr /tmp/gifsicle*
#!/bin/bash #!/bin/bash
set -o errexit set -e
# Install build deps # version check: https://github.com/ImageMagick/ImageMagick/releases
apt-get -y -q remove imagemagick IMAGE_MAGICK_VERSION="7.1.0-62"
IMAGE_MAGICK_HASH="d282117bc6d0e91ad1ad685d096623b96ed8e229f911c891d83277b350ef884a"
# We use debian, but GitHub CI is stuck on Ubuntu Bionic, so this must be compatible with both
LIBJPEGTURBO=$(cat /etc/issue | grep -qi Debian && echo 'libjpeg62-turbo libjpeg62-turbo-dev' || echo 'libjpeg-turbo8 libjpeg-turbo8-dev')
# Ubuntu 22.04/22.10 doesn't have libwebp6
LIBWEBP=$(cat /etc/issue | grep -qi 'Ubuntu 22' && echo 'libwebp7' || echo 'libwebp6')
PREFIX=/usr/local PREFIX=/usr/local
WDIR=/tmp/imagemagick WDIR=/tmp/imagemagick
mkdir -p $WDIR
# Build and install libpng # Install build deps
git clone -b v1.6.34 https://github.com/glennrp/libpng.git $WDIR/libpng apt -y -q remove imagemagick
cd $WDIR/libpng apt -y -q install git make gcc pkg-config autoconf curl g++ yasm cmake \
./autogen.sh libde265-0 libde265-dev ${LIBJPEGTURBO} x265 libx265-dev libtool \
./configure --prefix=$PREFIX libpng16-16 libpng-dev ${LIBJPEGTURBO} ${LIBWEBP} libwebp-dev libgomp1 \
make all && make install libwebpmux3 libwebpdemux2 ghostscript libxml2-dev libxml2-utils librsvg2-dev \
libltdl7-dev libbz2-dev gsfonts libtiff-dev libfreetype6-dev libjpeg-dev
# Ubuntu doesn't like `bullseye-backports`
if cat /etc/issue | grep -qi 'Ubuntu 22'; then
apt -y install libheif1 libaom-dev libheif-dev
else
# Use backports instead of compiling it
apt -y -q install -t bullseye-backports libheif1 libaom-dev libheif-dev
fi
mkdir -p $WDIR
cd $WDIR
# Build and install ImageMagick # Build and install ImageMagick
wget -O $WDIR/ImageMagick.tar.gz "https://github.com/ImageMagick/ImageMagick/archive/7.0.8-6.tar.gz" wget -q -O $WDIR/ImageMagick.tar.gz "https://github.com/ImageMagick/ImageMagick/archive/$IMAGE_MAGICK_VERSION.tar.gz"
sha256sum $WDIR/ImageMagick.tar.gz
echo "$IMAGE_MAGICK_HASH $WDIR/ImageMagick.tar.gz" | sha256sum -c
IMDIR=$WDIR/$(tar tzf $WDIR/ImageMagick.tar.gz --wildcards "ImageMagick-*/configure" |cut -d/ -f1) IMDIR=$WDIR/$(tar tzf $WDIR/ImageMagick.tar.gz --wildcards "ImageMagick-*/configure" |cut -d/ -f1)
tar zxf $WDIR/ImageMagick.tar.gz -C $WDIR tar zxf $WDIR/ImageMagick.tar.gz -C $WDIR
cd $IMDIR cd $IMDIR
...@@ -38,9 +58,15 @@ PKG_CONF_LIBDIR=$PREFIX/lib LDFLAGS=-L$PREFIX/lib CFLAGS=-I$PREFIX/include ./con ...@@ -38,9 +58,15 @@ PKG_CONF_LIBDIR=$PREFIX/lib LDFLAGS=-L$PREFIX/lib CFLAGS=-I$PREFIX/include ./con
--without-lcms \ --without-lcms \
--with-lzma \ --with-lzma \
--with-png \ --with-png \
--with-tiff --with-tiff \
--with-heic \
--with-rsvg \
--with-webp
make all && make install make all && make install
cd $HOME cd $HOME
rm -rf $WDIR rm -rf $WDIR
ldconfig /usr/local/lib ldconfig /usr/local/lib
# Validate ImageMagick install
test $(convert -version | grep -o -e png -e tiff -e jpeg -e freetype -e heic -e webp | wc -l) -eq 6
#!/bin/bash
set -e
# version check: https://github.com/jemalloc/jemalloc/releases
# jemalloc stable
mkdir /jemalloc-stable
cd /jemalloc-stable
wget -q https://github.com/jemalloc/jemalloc/releases/download/3.6.0/jemalloc-3.6.0.tar.bz2
sha256sum jemalloc-3.6.0.tar.bz2
echo "e16c2159dd3c81ca2dc3b5c9ef0d43e1f2f45b04548f42db12e7c12d7bdf84fe jemalloc-3.6.0.tar.bz2" | sha256sum -c
tar --strip-components=1 -xjf jemalloc-3.6.0.tar.bz2
./configure --prefix=/usr && make && make install
cd / && rm -rf /jemalloc-stable
# jemalloc new
mkdir /jemalloc-new
cd /jemalloc-new
wget -q https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2
sha256sum jemalloc-5.3.0.tar.bz2
echo "2db82d1e7119df3e71b7640219b6dfe84789bc0537983c3b7ac4f7189aecfeaa jemalloc-5.3.0.tar.bz2" | sha256sum -c
tar --strip-components=1 -xjf jemalloc-5.3.0.tar.bz2
./configure --prefix=/usr --with-install-suffix=5.3.0 && make build_lib && make install_lib
cd / && rm -rf /jemalloc-new
#!/bin/bash
set -e
# version check: https://github.com/shssoichiro/oxipng/releases
OXIPNG_VERSION="8.0.0"
OXIPNG_HASH="ef96d6340e70900de0a38ace8f5f20878f6c256b18b0c59cd87f2b515437b87b"
OXIPNG_ARCHIVE="v${OXIPNG_VERSION}.tar.gz"
OXIPNG_DIR="oxipng-${OXIPNG_VERSION}"
# Install other deps
apt-get -y install advancecomp jhead jpegoptim libjpeg-turbo-progs optipng
cd /tmp
wget -q https://github.com/shssoichiro/oxipng/archive/refs/tags/${OXIPNG_ARCHIVE}
sha256sum ${OXIPNG_ARCHIVE}
echo "${OXIPNG_HASH} ${OXIPNG_ARCHIVE}" | sha256sum -c
tar -zxf ${OXIPNG_ARCHIVE}
cd ${OXIPNG_DIR}
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse /usr/local/cargo/bin/cargo build --release
cp target/release/oxipng /usr/local/bin
cd / && rm -fr /tmp/${OXIPNG_DIR}
#!/bin/bash
set -e
PNGCRUSH_VERSION=1.8.13
cd /tmp
wget https://sourceforge.net/projects/pmt/files/pngcrush/$PNGCRUSH_VERSION/pngcrush-$PNGCRUSH_VERSION.tar.gz/download -O pngcrush-$PNGCRUSH_VERSION.tar.gz
tar zxf pngcrush-$PNGCRUSH_VERSION.tar.gz
cd pngcrush-$PNGCRUSH_VERSION
make && cp -f pngcrush /usr/local/bin
cd /
rm -fr /tmp/pngcrush-$PNGCRUSH_VERSION
rm /tmp/pngcrush-$PNGCRUSH_VERSION.tar.gz
#!/bin/bash
VERSION=2.12.1
cd /tmp
git clone -b $VERSION --single-branch https://github.com/pornel/pngquant
cd pngquant
make && make install
cd /
rm -fr /tmp/pngq*
#!/bin/bash
set -e
RUBY_VERSION="3.2.2"
export CONFIGURE_OPTS="--enable-yjit"
apt-get -y install --no-install-recommends ruby bison libffi-dev
mkdir /src
git -C /src clone https://github.com/rbenv/ruby-build.git
cd /src/ruby-build && ./install.sh
cd / && rm -fr /src
ruby-build ${RUBY_VERSION} /usr/local
apt-get -y purge ruby
#!/bin/bash
set -e
# see https://github.com/rust-lang/docker-rust/blob/master/Dockerfile-debian.template
export RUSTUP_HOME=/usr/local/rustup
export CARGO_HOME=/usr/local/cargo
export PATH=/usr/local/cargo/bin:$PATH
export RUST_VERSION=1.68.0
export RUSTUP_VERSION=1.25.2
dpkgArch="$(dpkg --print-architecture)"
case "${dpkgArch##*-}" in
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='bb31eaf643926b2ee9f4d8d6fc0e2835e03c0a60f34d324048aa194f0b29a71c' ;;
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='6626b90205d7fe7058754c8e993b7efd91dedc6833a11a225b296b7c2941194f' ;;
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='4ccaa7de6b8be1569f6b764acc28e84f5eca342f5162cd5c810891bff7ed7f74' ;;
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='34392b53a25c56435b411d3e575b63aab962034dd1409ba405e708610c829607' ;;
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;;
esac
url="https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/${rustArch}/rustup-init"
wget "$url"
echo "${rustupSha256} *rustup-init" | sha256sum -c -
chmod +x rustup-init
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}
rm rustup-init
chmod -R a+w $RUSTUP_HOME $CARGO_HOME
rustup --version
cargo --version
rustc --version
Subproject commit 85dc24d6b58d1b16e6d225ae710633dc20c34d08
Subproject commit 248ccf70bdb8b5f3e773688cb2954548cd0fb9d9
Subproject commit 56b0de3896361b6a87523537c8f5b450d2fe0807
Subproject commit 84ef46a38cf02748ecacad16c5d9c6fec12dc8da
Subproject commit 94c7b7da216c66d773f800a714493f087affaac9