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.

UbuntuのGUI環境にPython + GOの環境を爆速で構築

Last updated at Posted at 2023-06-02

目的

前回の記事ではUbuntuのGUI環境にPythonの環境を用意した。
用意したと言ってもpipをインストールするだけだったので、今回はGOの環境も追加しようと思う

TL;DL

version: '3.3'
services:
    docker-ubuntu-desktop:
        ports:
           - '6080:6080'
        image: shomaigu/guiubuntugopy:latest
        container_name: 'guiubuntupy'
        working_dir: /root/Desktop
        volumes:
           - ./work:/root/Desktop
docker-compose up

アクセス

自分でビルドする場合

docker-compose.yml
version: '3.3'
services:
    docker-ubuntu-desktop:
        ports:
           - '6080:6080'
        build: .
        container_name: 'guiubuntupy'
        working_dir: /root/Desktop
        volumes:
           - ./work:/root/Desktop
FROM akarita/docker-ubuntu-desktop
RUN apt-get -y update && apt-get -y install python3-pip nano
RUN wget https://go.dev/dl/go1.20.4.linux-amd64.tar.gz
RUN mkdir -p /usr/local/go/bin
RUN tar -C /usr/local -xzf go1.20.4.linux-amd64.tar.gz
ENV PATH $PATH:/usr/local/go/bin
docker-compose up

前回のDockerfile

このDockerfileをGoも動く様にする。

FROM akarita/docker-ubuntu-desktop
RUN apt-get -y update && apt-get -y install python3-pip nano

Go構築

aptで入れてしまうと、更新が遅い場合があるため、今回はソースからインストールしていく。

最新版の検索

以下のサイトにアクセスして、最新版のURLを手に入れる
https://go.dev/dl/

FROM akarita/docker-ubuntu-desktop
RUN apt-get -y update && apt-get -y install python3-pip nano
RUN wget https://go.dev/dl/go1.20.4.linux-amd64.tar.gz
RUN mkdir -p /usr/local/go/bin
RUN tar -C /usr/local -xzf go1.20.4.linux-amd64.tar.gz
ENV PATH $PATH:/usr/local/go/bin

ビルド・起動

docker-compose build
docker-compose up

go確認

image.png

python確認

image.png

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?