0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Rust初心者】Rustの日本語ドキュメントを自分なりにまとめてみた(その0)

Last updated at Posted at 2023-06-20

この記事は、2023年6月に作成したものです。

はじめに

以前から興味があったRustを、日本語のドキュメントをもとに、学習を始めました!
自分の考えをまとめるために、記事を書いていこうと思います。

また、全くの初心者なので、間違っている点などがありましたら、コメントでご指摘お願いします!

この記事でできること

Dockerを使ってRustの開発環境を構築します。
Rustの環境ができている方は飛ばしてください。

環境

  • macOS Monterey == 12.5
  • Docker == 23.0.5
  • Rust == 1.70.0
  • Cargo == 1.70.0

Dockerfileの記述

まずは任意のディレクトリにDockerファイルを作成し、中身を書いていきます。
私は、最新バージョンのRustを使用しています。

FROM rust:latest

RUN mkdir -p root/workspace
WORKDIR /root/workspace

docker-composeファイルの記述

Dockerfileが書けたら、次はcomposeファイルを書いていきます。

docker-compose.yml
version: '3'
  services:
    rust:
      build:
        context: #Dockerfileのあるディレクトリ
        dockerfile: Dockerfile
      container_name: rust
      
      tty: true
      
      volumes:
        - ./src:/root/workspace
      
      environment:
        - USER=user

docker-composeファイルのビルドと起動

下記のコマンドでcomposeファイルをビルドし起動させます。
お好みで-dもつけてください。

docker-compose up

これで、ついにRustの環境を構築できました!
次回からは、実際にRustのコードを書いていきましょう!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?