龙空技术网

基于Docker + Ubuntu进行Rust环境搭建

宏推 1168

前言:

当前姐妹们对“ubuntuc语言环境”大致比较关怀,咱们都需要分析一些“ubuntuc语言环境”的相关知识。那么小编也在网络上搜集了一些有关“ubuntuc语言环境””的相关内容,希望大家能喜欢,小伙伴们一起来了解一下吧!

build

docker build -t shaipe/rust-ubuntu:latest ./
Installation
# 运行dockerdocker run -idt \--name urust \--restart always \-v ~/workspace/rust:/data \-w /data \shaipe/ubuntu \/bin/bash# 进入docker环境docker exec -it rust-ubuntu bash# 系统升级apt-get update && apt-get install curl && apt-get install vim# install rustcurl --proto '=https' --tlsv1.2 -sSf  | sh# config PATHvim ~/.bashrc# insert pathexport PATH="$HOME/.cargo/bin:$PATH"source ~/.bashrc# install ssh certapt-get install -y ca-certificates# open sslapt-get install -y openssl# install cc builder not install complie error: linker `cc` not found# To install gcc on Ubuntu, simply run:apt install build-essentialapt install libssl-devapt install openssl-devel# install and config opensslapt install pkg-config
config cargo source
# write `$HOME/.cargo/config` in file[source.crates-io]registry = ";# replace you like sourcereplace-with = 'sjtu'#replace-with = 'ustc'# qinghua[source.tuna]registry = ";# zhong ke da[source.ustc]registry = "git://mirrors.ustc.edu.cn/crates.io-index"# shanghai jiaotong [source.sjtu]registry = ";# rustcc comtriy[source.rustcc]registry = "git://crates.rustcc.cn/crates.io-index"
commit Image

docker commit -m 'update' rust-ubuntu shaipe/rust-ubuntu

docker push shaipe/rust-ubuntu

use image

docker run -idt \--name urust \--restart always \-v ~/workspace/rust:/data \shaipe/ubuntu \/bin/bash

标签: #ubuntuc语言环境