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.

[備忘録]Docker HUBにPushする手順

Last updated at Posted at 2023-07-26

目的

Docker HUBにpushする手順を毎回忘れてしまうので、今回は備忘録として手順を残しておく

TL;DL

既にイメージがある場合

root@shoma:/home/shoma/rasp# docker image ls
REPOSITORY           TAG               IMAGE ID       CREATED          SIZE
raspios_lite_arm64   2023-08-30        80d8608a6897   3 minutes ago    1.12GB
<none>               <none>            b891f9aacdad   30 minutes ago   1.12GB
shomaigu/ubuntu      latest            b902fc608e64   3 weeks ago      55.3MB
<none>               <none>            0fc35c5cfea4   3 weeks ago      55.3MB
ubuntu               latest            01f29b872827   3 weeks ago      77.8MB
moby/buildkit        buildx-stable-1   4730994867e3   3 weeks ago      157MB
shomaigu/nagios      latest            1f7ed18d4478   9 months ago     794MB
jasonrivers/nagios   latest            35a80d248559   9 months ago     794MB

タグ付け+push

docker tag raspios_lite_arm64:2023-08-30 shomaigu/raspios_lite_arm64:2023-08-30
docker push shomaigu/raspios_lite_arm64:2023-08-30

dockerでビルドする場合

docker build ./ubpy -t shomaigu/sotsuken-python:latest
docker login
docker push shomaigu/sotsuken-python:latest

./ubpyで、ビルドコンテキストを指定する。
-tでタグ付けを行う。

docker-composeでビルドする場合

docker-compose.yml

docker-compose.yml
version: "3.9"
services:
  dhcp4sv:
    build: ./v4
    image: shomaigu/dhcp4:1.0.0

buildの下にimageの行を入れる事でビルドしたイメージにタグ付けを行う事が出来る。

docker login
docker push shomaigu/dhcp4:1.0.0
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?