1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

dokcer image buildでエラー吐いたのでubuntuを更新した。

Last updated at Posted at 2024-04-09

docker-imageを作成するべく
作業ディレクトリのサブにapacheディレクトリを作成し
その中にDockerfileを作成。

FROM ubuntsu:21.10

RUN apt update \
	&& apt install -y apache2

CMD ["apachectl", "-D", "FOREGROUND"]

以上を$ dokcer image build -t practice/apachest:latest

すると

2.933 Err:5 http://ports.ubuntu.com/ubuntu-ports impish Release
2.933   404  Not Found 
3.233 Err:6 http://ports.ubuntu.com/ubuntu-ports impish-updates Release
3.233   404  Not Found 
3.547 Err:7 http://ports.ubuntu.com/ubuntu-ports impish-backports Release
3.547   404  Not Found 
3.856 Err:8 http://ports.ubuntu.com/ubuntu-ports impish-security Release
3.856   404  Not Found 
3.867 Reading package lists...
3.903 E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish Release' does not have a Release file.
3.903 E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish-updates Release' does not have a Release file.
3.903 E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish-backports Release' does not have a Release file.
3.903 E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish-security Release' does not have a Release file.
------
Dockerfile:3
--------------------
   2 |     
   3 | >>> RUN apt update \
   4 | >>>   && apt install -y apache2
   5 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt update   && apt install -y apache2" did not complete successfully: exit code: 100

Err:5 http://ports.ubuntu.com/ubuntu-ports impish
超意訳すると"そんなリリースねーよ"と。

調べるとubuntuがバージョン21.10のサポートを2022年7月で終了していた。

なのでubuntuのページを訪問し、22.04(Jammy Jellyfish)が2027年4月までサポートしているそうなので、バージョンを書き換えて再実行。

※docker使うならdocker hubからも、使用できるubuntuを調べられますね。https://hub.docker.com/_/ubuntu

[+] Building 47.6s (6/6) FINISHED                                   docker:desktop-linux

$docker image ls
で確認すると

REPOSITORY           TAG       IMAGE ID       CREATED          SIZE
practice/apache      latest    5d3172bcbcdc   40 minutes ago   221MB

docker imageが無事に出来ていました。

参考:
Ubuntu 20.10でapt-get updateしたらエラーが出た
https://blog.denet.co.jp/i-got-an-error-when-i-did-apt-get-update-on-ubuntu-20-10/

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?