我想运行一个 Docker 容器,它只在所述主机上的 docker 实例中内部公开它的端口。这意味着我不希望它公开。
如何从命令行执行此操作?下面的代码公开打开它。
docker run -p 27017:27017 --name mongo mongo
Run Code Online (Sandbox Code Playgroud) 正如标题所说,我想将我的 ssh 密钥复制到服务器,然后出于安全原因禁用 root 密码登录。
我正在使用 JuiceSSH,但它似乎缺少免费版本的 ssh-copy-id。
任何支持此命令的应用程序?
RUN apt-get update && \
# Install locales
apt-get install -y locales && \
# Set locale
sed --in-place '/en_US.UTF-8/s/^# //' /etc/locale.gen && \
locale-gen && \
# Set system locale (add line)
echo "export LANG=en_US.UTF-8" >> /etc/profile && \
# Set system timezone (add line)
echo "export TZ=UTC" >> /etc/profile && \
# If the user will not change, we must source
source /etc/profile
Run Code Online (Sandbox Code Playgroud)
我在 GitLab 管道中使用该图像,并显示以下内容:
$ cat /etc/profile
# /etc/profile: system-wide .profile file for the Bourne shell …Run Code Online (Sandbox Code Playgroud)