Docker 安裝-AWS EC2 流程

如何在AWS EC2 上安裝 Docker 環境

一、進入服務器後執行 yum install -y docker

[root@localhost ~]# yum install docker
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 0:18.09.9ce-2.52.amzn1 will be installed
--> Processing Dependency: runc = 1.0.0 for package: docker-18.09.9ce-2.52.amzn1.x86_64
--> Processing Dependency: containerd = 1.2.6 for package: docker-18.09.9ce-2.52.amzn1.x86_64
--> Processing Dependency: xfsprogs for package: docker-18.09.9ce-2.52.amzn1.x86_64
--> Processing Dependency: pigz for package: docker-18.09.9ce-2.52.amzn1.x86_64
--> Processing Dependency: libseccomp.so.2()(64bit) for package: docker-18.09.9ce-2.52.amzn1.x86_64
--> Running transaction check
---> Package containerd.x86_64 0:1.2.6-1.2.amzn1 will be installed
---> Package libseccomp.x86_64 0:2.3.1-2.4.amzn1 will be installed
---> Package pigz.x86_64 0:2.3.3-1.6.amzn1 will be installed
---> Package runc.x86_64 0:1.0.0-0.1.20190510.git2b18fe1.0.amzn1 will be installed
---> Package xfsprogs.x86_64 0:4.5.0-18.23.amzn1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================
 Package      Arch       Version                                Repository     Size
====================================================================================
Installing:
 docker       x86_64     18.09.9ce-2.52.amzn1                   amzn-updates   35 M
Installing for dependencies:
 containerd   x86_64     1.2.6-1.2.amzn1                        amzn-updates   26 M
 libseccomp   x86_64     2.3.1-2.4.amzn1                        amzn-main      79 k
 pigz         x86_64     2.3.3-1.6.amzn1                        amzn-main      71 k
 runc         x86_64     1.0.0-0.1.20190510.git2b18fe1.0.amzn1  amzn-updates  2.3 M
 xfsprogs     x86_64     4.5.0-18.23.amzn1                      amzn-updates  1.7 M

Transaction Summary
====================================================================================
Install  1 Package (+5 Dependent packages)

Total download size: 65 M
Installed size: 223 M
Is this ok [y/d/N]: y
Downloading packages:
(1/6): libseccomp-2.3.1-2.4.amzn1.x86_64.rpm                     |  79 kB  00:00:00     
(2/6): pigz-2.3.3-1.6.amzn1.x86_64.rpm                           |  71 kB  00:00:00     
(3/6): runc-1.0.0-0.1.20190510.git2b18fe1.0.amzn1.x86_64.rpm     | 2.3 MB  00:00:01     
(4/6): containerd-1.2.6-1.2.amzn1.x86_64.rpm                     |  26 MB  00:00:03     
(5/6): xfsprogs-4.5.0-18.23.amzn1.x86_64.rpm                     | 1.7 MB  00:00:00     
(6/6): docker-18.09.9ce-2.52.amzn1.x86_64.rpm                    |  35 MB  00:00:05     
------------------------------------------------------------------------------------
Total                                                                                                       11 MB/s |  65 MB  00:00:05     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libseccomp-2.3.1-2.4.amzn1.x86_64                           1/6 
  Installing : runc-1.0.0-0.1.20190510.git2b18fe1.0.amzn1.x86_64           2/6 
  Installing : containerd-1.2.6-1.2.amzn1.x86_64                           3/6 
  Installing : pigz-2.3.3-1.6.amzn1.x86_64                                 4/6 
  Installing : xfsprogs-4.5.0-18.23.amzn1.x86_64                           5/6 
  Installing : docker-18.09.9ce-2.52.amzn1.x86_64                          6/6 
  Verifying  : docker-18.09.9ce-2.52.amzn1.x86_64                          1/6 
  Verifying  : xfsprogs-4.5.0-18.23.amzn1.x86_64                           2/6 
  Verifying  : libseccomp-2.3.1-2.4.amzn1.x86_64                           3/6 
  Verifying  : containerd-1.2.6-1.2.amzn1.x86_64                           4/6 
  Verifying  : runc-1.0.0-0.1.20190510.git2b18fe1.0.amzn1.x86_64           5/6 
  Verifying  : pigz-2.3.3-1.6.amzn1.x86_64                                 6/6 

Installed:
  docker.x86_64 0:18.09.9ce-2.52.amzn1                                                                                                     

Dependency Installed:
  containerd.x86_64 0:1.2.6-1.2.amzn1                       libseccomp.x86_64 0:2.3.1-2.4.amzn1       pigz.x86_64 0:2.3.3-1.6.amzn1      
  runc.x86_64 0:1.0.0-0.1.20190510.git2b18fe1.0.amzn1       xfsprogs.x86_64 0:4.5.0-18.23.amzn1      

Complete!
閱讀更多

MacOS「XXX.APP」已損毀,無法打開。您應該將其丟到「垃圾桶」。

當你在安裝網路上,下載下來的APP,安裝完成後出現
「XXX.APP」已損毀,無法打開。您應該將其丟到「垃圾桶」。

這時候有兩個方式可以解除

一、使用 sudo spctl --master-disable 開啟任何來源

1.關閉「系統偏好設定」
2.打開「終端機」,輸入以下指令

MacBook-Pro ~ % sudo spctl --master-disable
Password: 輸入密碼驗證

3.再次打開「系統偏好設定」 > 「安全性與隱私」 >「一般」
如下圖:

二、使用 sudo xattr -d com.apple.quarantine /Applications/xxx.app

1.打開「終端機」,輸入以下指令

MacBook-Pro ~ % sudo xattr -d com.apple.quarantine /Applications/xxx.app
Password: 輸入密碼驗證

2.重新啟動 APP 即可

[Worker Man]安裝流程-AWS

安裝說明

WorkerMan實際上就是一個PHP代碼包,如果你的PHP環境已經裝好,只需要把WorkerMan源代碼或者demo下載下來即可運行。

安裝php 7.2

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

[root@workerman ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
warning: /var/tmp/rpm-tmp.O2pe84: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:epel-release-7-11                ################################# [100%]

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

[root@workerman ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
warning: /var/tmp/rpm-tmp.O2pe84: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:epel-release-7-11                ################################# [100%]
閱讀更多

Unix/Linux 的 find 指令使用教學、技巧與範例整理

Find的實用教學

指定檔名搜尋

若要在目前的目錄底下,找尋檔案名稱為 gtwang.txt 的檔案,可以使用:

find . -name gtwang.txt

執行後,find 會列出所有檔名是 gtwang.txt 的檔案列表。

./gtwang/gtwang.txt

在 /home 目錄底下,找尋檔案名稱為 gtwang.txt 的檔案:

find /home -name gtwang.txt
閱讀更多

[Ubuntu]在AWS上實現 ubuntu 遠程桌面

在Linux主機上進行ssh指令操作已經一段時間了,後來想說來個圖形化介面,再加上遠端桌面,感覺就可以開始辦工了,所以在網路上找了一下相關資訊。原來這已經很多人這樣做了,這次就把相關的安裝流程寫下,方便日後安裝時使用。

所使用到的版本及套件

  • 用戶端 – Windows Remote Desktop
  • 主機端 – Ubuntu Server 18.04 LTS
  • 連線協議 – RDP / XRDP
  • 圖像桌面 – XFCE4
閱讀更多

[Brew] 如何在Mac安裝 Homebrew

How to Install Homebrew on Mac

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

MacBook-Pro:tmp user$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable:
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/share
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man5
/usr/local/share/man/man7
==> The following existing directories will have their owner set to blackie:
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/share
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man5
/usr/local/share/man/man7
==> The following existing directories will have their group set to admin:
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/share
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man5
/usr/local/share/man/man7
==> The following new directories will be created:
/usr/local/etc
/usr/local/sbin
/usr/local/var
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew
/usr/local/var/homebrew/linked
/usr/local/Cellar
/usr/local/Caskroom
/usr/local/Homebrew
/usr/local/Frameworks

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin /usr/local/include /usr/local/lib /usr/local/share /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man5 /usr/local/share/man/man7
Password:

閱讀更多

[Composer] 如何在 Mac 上安裝

如何在 Mac 上安裝 Composer

安裝composer

安裝前需確保系統PHP版本在5.3以上,在終端中執行以下命令下載Composer可執行文件:

MacBook-Pro:tmp user$ curl -sS https://getcomposer.org/installer | php

此操作會下載最新版本到當前的工作目錄中。

 

如查看Composer版本

MacBook-Pro:tmp user$ php composer.phar --version
MacBook-Pro:tmp user$ Composer version 1.7.2 2018-08-16 16:57:12

閱讀更多

[Ajax] 如何製作 header 傳送及接收資料以及 CORS 問題

如何製作 header 傳送及接收資料

之前想說在header帶上參數,就可以POST到另一個API調用資料,這是一件很單純的問題,沒想到竟然這麼多問題啊!!

研究了很久,怎麼傳都無法傳過去,

  1. 先是 CROS (Cross-origin resource sharing)
  2. header 設定方式
  3. 接收 header 的一些基本問題

以下是 ajax 的範例表式。

閱讀更多