我有一个 12.04.4 服务器,我启用了 ufw,并试图阻止 port 8080。但是,它仍然是开放的。
$ sudo ufw deny 8080
Rule added
Rule added (v6)
$ sudo ufw status numbered
Status: active
To Action From
-- ------ ----
[ 1] 22 ALLOW IN Anywhere
[ 2] 80 ALLOW IN Anywhere
[ 3] 8080 DENY IN Anywhere
[ 4] 22 ALLOW IN Anywhere (v6)
[ 5] 80 ALLOW IN Anywhere (v6)
[ 6] 8080 DENY IN Anywhere (v6)
Run Code Online (Sandbox Code Playgroud)
想法?我仍然可以访问8080上的网站。我已经重新启动了几次系统。IP 地址是通过静态分配处理的,但我找不到任何表明这是问题的内容。
我试图阻止的服务在 docker 实例上,但是这个问题没有帮助。
为什么 lxc-docker 被阻止?我还注意到我的 Web 应用程序在 Docker 上运行,速度很慢。有什么建议?
[lucas@production]/home/lucas$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
linux-image-3.16.0-28-generic
Use 'apt-get autoremove' to remove it.
The following packages have been kept back:
lxc-docker
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
[lucas@production]/home/lucas$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... …Run Code Online (Sandbox Code Playgroud) 据答案约泊坞窗这个问题,运行它作为一个非root是那么容易,因为添加的非root用户名到docker组,注销并回。果然,当我用它作为sudo对hello-world图像进展顺利。但是对于另一个名为whalefortune我的测试图像,我仍然收到access denied错误——见下文。
通常不再可以以非 root 用户身份运行 docker 了吗?我使用的是 Ubuntu 19.04,它比示例版本更新,并且有人提到可能存在以非 root 身份运行 docker 的安全漏洞。
我的想法是以普通用户身份运行 nvidia-docker,这可能吗(甚至是个好主意)?
$ sudo docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:6540fc08ee6e6b7b63468dc3317e3303aae178cb8a45ed3123180328bcc1d20f
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker …Run Code Online (Sandbox Code Playgroud) 我已经在我的ubuntu 机器上安装了 docker,它作为 service在后台运行。我现在如何访问docker 仪表板?有什么方法可以访问它。
尝试执行以下操作时遇到以下问题docker-compose up:
[10:46:31] coil@coil:~/workspace/docker$ docker-compose up -d
ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.
[10:48:00] coil@coil:~/workspace/docker$ docker-machine start default
Docker machine "default" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one.
[10:57:07] coil@coilZ240:~/workspace/docker$ sudo docker-machine create default
Running pre-create checks...
Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"
[11:00:17] coil@coilZ240:~/workspace/docker$ VBoxManage -v …Run Code Online (Sandbox Code Playgroud) 我安装了 Ubuntu 16.04.6 LTS。
之前我已经从其存储库将 Docker 安装为docker.io包。
昨天我用 LXD 安装了 LXC,我想它们与 Docker 共存存在一些问题。
LXC正常工作:
Run Code Online (Sandbox Code Playgroud)$ lxc exec ubuntu-test -- su --login ubuntu-test ~ #
现在,当我尝试启动 docker 容器时,docker run出现错误:
Run Code Online (Sandbox Code Playgroud)docker: Error response from daemon: cgroups: cannot find cgroup mount destination: unknown.
如何通过启动 Docker 容器来解决此问题?
如果可能,请建议同时安装 Docker 和 LXC/LXD 的解决方案。
一些调试信息:
$ mount | grep cgroup
tmpfs on /sys/fs/cgroup type tmpfs (rw,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpu,cpuacct type …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的计算机(Ubuntu)上安装 docker-compose,在使用curl、wget 和 apt 多次尝试失败后,我决定从存储库下载它的目录并将其移动到 usr/local/bin/docker-compose。
但是,我不断收到错误Cannot open self /usr/local/bin/docker-compose or archive /usr/local/bin/docker-compose.pkg
我尝试了几种方法: - 重新安装 - 更改文件权限 - 使用 wget、curl 和 apt 安装,但它不起作用。
我在服务器(docker 容器)上使用 Ubuntu 20.04,我需要以编程方式安装字体。我在下面添加文件,~/.fonts同时它可以立即工作,但.ttf我无法使其与.woff文件一起工作。
过去,我通过 Debian 10 将文件复制到同一位置而不进行任何转换来实现这一目标。
我是否缺少需要安装的 Ubuntu 软件包,或者我是否需要将字体转换为.ttf?如果是这样,推荐的转换方法是woff什么ttf?
我sudo apt update在终端运行等等,然后我得到了这个错误。我无法复制并粘贴此错误代码,所以我想知道可能是什么问题。是权限问题还是其他什么问题?
An error occurred, please run Package Manager from the right-click menu
or apt-get in a terminal to see what is wrong
Run Code Online (Sandbox Code Playgroud)
错误信息:
Error: Opening the cache (E:can not open /var/lib/apt/lists/download.docker.com linux_ubuntu_dists_focal InRelease
- fopen (13: Permission denied),
E:The package lists or status file could not be parsed or opened.
This usually means that your installed packages have unmet dependencies.
Run Code Online (Sandbox Code Playgroud)
我发现了这个问题,但那个问题使用了 cron - 我想改用 systemd 服务。我docker-compose.yml的在 中/home/me,我用 运行它sudo docker compose up(并用 让它在后台运行tmux),并用 停止它sudo docker compose down。
虽然功能正常,但我宁愿使用 systemd 服务来启动/停止我的docker-compose.yml文件。
如何将我的docker-compose.yml文件变成(工作的)systemd 服务?