当前位置: 代码网 > 服务器>服务器>云虚拟主机 > Alpine镜像中如何安装telnet

Alpine镜像中如何安装telnet

2024年07月02日 云虚拟主机 我要评论
alpine镜像是一个基于alpine linux发行版构建的docker镜像,具有以下特点和优势:小巧轻量:alpine linux的基础镜像非常小巧,通常只有几mb大小(例如,只有5 mb左右,对

alpine镜像是一个基于alpine linux发行版构建的docker镜像,具有以下特点和优势:

  • 小巧轻量:alpine linux的基础镜像非常小巧,通常只有几mb大小(例如,只有5 mb左右,对比ubuntu系列镜像接近200 mb),这使得它启动更快,占用更少的磁盘空间。
  • 安全可靠:alpine linux专注于提供一个安全的操作系统,它采用了musl libc来替代glibc,musl libc被认为更加安全,且对于容器化应用来说,足够满足需求。
  • 易于定制:alpine镜像提供了一个简单的基础环境,可以根据需要添加所需的软件包,定制自己的镜像。alpine linux使用了apk包管理工具,安装和卸载软件包非常方便。
  • 社区支持:alpine linux拥有一个活跃的社区,提供了大量的文档和支持。在docker社区中,有很多基于alpine镜像的开源项目和dockerfile,可以方便地获取和使用。

alpine镜像的广泛应用得益于其小巧、安全、易于定制和活跃的社区支持等特点,特别是在容器化应用场景下,它成为了首选的基础镜像。使用alpine镜像可以带来多个好处,包括镜像下载速度加快,镜像安全性提高,主机之间的切换更方便,占用更少磁盘空间等。

此外,alpine linux提供了自己的包管理工具apk,使得用户可以通过apk命令直接查询和安装各种软件。alpine镜像也适用于更多常用场景,是一个优秀的可以适用于生产的基础系统/环境。

alpine镜像安装软件

alpine镜像安装telnet

alpine镜像中的telnet在3.7版本后被转移至busybox-extras包中:

$ apk update
$ apk add busybox-extras
$telnet smtp.163.com 25   #telnet 确认指定端口是否开启

alpine镜像安装mysql客户端

$ apk add --no-cache mysql-client

busybox

busybox命令工具是一个面向嵌入式系统的工具集合,它提供了一个精简的unix工具集合,包括了许多常用的命令和工具。

busybox的主要特点

  • 轻量级:busybox的可执行文件非常小巧,适用于资源受限的环境。
  • 功能强大:包含了许多常见的unix命令,如ls、cat、cp、mv、rm等,用于文件和目录管理、网络管理、系统管理、软件包管理以及系统设置等。
  • 灵活性:提供了许多编译选项,可以根据需求选择需要的工具,并排除不需要的工具。
  • 兼容性:busybox的工具与传统的unix工具具有相似的命令行接口和功能,可以方便地替代传统的unix工具。

busybox的常用命令

busybox包含了许多常见的unix命令,其中一些常见的命令包括:

  • ls:列出文件和目录。
  • cp:复制文件和目录。
  • mv:移动文件和目录。
  • rm:删除文件和目录。
  • cat:查看文件内容。
  • find:搜索文件和目录。
  • ifconfig、route:用于网络配置和路由表管理。
  • ps、top、kill:用于进程查看和管理。
  • tar、gzip:用于打包和压缩文件。
  • mount、umount:用于挂载和卸载文件系统。

busybox提供的所有命令如下:

$ busybox
busybox v1.36.1 (2023-11-07 18:53:09 utc) multi-call binary.
busybox is copyrighted by many authors between 1998-2015.
licensed under gplv2. see source distribution for detailed
copyright notices.
usage: busybox [function [arguments]...]
   or: busybox --list[-full]
   or: busybox --install [-s] [dir]
   or: function [arguments]...
        busybox is a multi-call binary that combines many common unix
        utilities into a single executable.  most people will create a
        link to busybox for each function they wish to use and busybox
        will act like whatever it was invoked as.
currently defined functions:
        [, [[, acpid, add-shell, addgroup, adduser, adjtimex, arch, arp, arping, ash, awk, base64, basename, bbconfig, bc, beep, blkdiscard,
        blkid, blockdev, brctl, bunzip2, bzcat, bzip2, cal, cat, chattr, chgrp, chmod, chown, chpasswd, chroot, chvt, cksum, clear, cmp, comm,
        cp, cpio, crond, crontab, cryptpw, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod, df, diff, dirname, dmesg, dnsdomainname,
        dos2unix, du, dumpkmap, echo, egrep, eject, env, ether-wake, expand, expr, factor, fallocate, false, fatattr, fbset, fbsplash, fdflush,
        fdisk, fgrep, find, findfs, flock, fold, free, fsck, fstrim, fsync, fuser, getopt, getty, grep, groups, gunzip, gzip, halt, hd, head,
        hexdump, hostid, hostname, hwclock, id, ifconfig, ifdown, ifenslave, ifup, init, inotifyd, insmod, install, ionice, iostat, ip, ipaddr,
        ipcalc, ipcrm, ipcs, iplink, ipneigh, iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5, klogd, last, less, link, linux32,
        linux64, ln, loadfont, loadkmap, logger, login, logread, losetup, ls, lsattr, lsmod, lsof, lsusb, lzcat, lzma, lzop, lzopcat, makemime,
        md5sum, mdev, mesg, microcom, mkdir, mkdosfs, mkfifo, mkfs.vfat, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount,
        mountpoint, mpstat, mv, nameif, nanddump, nandwrite, nbd-client, nc, netstat, nice, nl, nmeter, nohup, nologin, nproc, nsenter,
        nslookup, ntpd, od, openvt, partprobe, passwd, paste, pgrep, pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap, poweroff,
        printenv, printf, ps, pscan, pstree, pwd, pwdx, raidautorun, rdate, rdev, readahead, readlink, realpath, reboot, reformime,
        remove-shell, renice, reset, resize, rev, rfkill, rm, rmdir, rmmod, route, run-parts, sed, sendmail, seq, setconsole, setfont,
        setkeycodes, setlogcons, setpriv, setserial, setsid, sh, sha1sum, sha256sum, sha3sum, sha512sum, showkey, shred, shuf, slattach, sleep,
        sort, split, stat, strings, stty, su, sum, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, tee, test, time,
        timeout, top, touch, tr, traceroute, traceroute6, tree, true, truncate, tty, ttysize, tunctl, udhcpc, udhcpc6, umount, uname, unexpand,
        uniq, unix2dos, unlink, unlzma, unlzop, unshare, unxz, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, volname, watch,
        watchdog, wc, wget, which, who, whoami, whois, xargs, xxd, xzcat, yes, zcat, zcip

busybox-extras提供的所有命令如下:

$ busybox-extras
busybox v1.36.1 (2024-06-12 06:28:12 utc) multi-call binary.
busybox is copyrighted by many authors between 1998-2015.
licensed under gplv2. see source distribution for detailed
copyright notices.
usage: busybox [function [arguments]...]
   or: busybox --list[-full]
   or: busybox --install [-s] [dir]
   or: function [arguments]...
        busybox is a multi-call binary that combines many common unix
        utilities into a single executable.  most people will create a
        link to busybox for each function they wish to use and busybox
        will act like whatever it was invoked as.
currently defined functions:
        arch, conspy, dnsd, dumpleases, fakeidentd, ftpd, ftpget, ftpput, httpd, inetd, readahead, tcpsvd, telnet, telnetd, tftp, tftpd,
        udhcpd

busybox的优缺点

优点:轻量级、功能强大、灵活性和兼容性好。
缺点:由于busybox的设计目标是提供一个精简的工具集,因此某些高级功能可能不支持;对于不熟悉busybox的用户来说,可能需要一些时间来适应其命令行接口和工具的使用方式。

总的来说,busybox是一个在嵌入式系统和资源受限环境中广泛使用的工具集合,它为用户提供了轻量级、功能强大和灵活的命令行工具集。

补充:alpine安装telnet、curl等命令

镜像加速:

sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories

apk库更新:

apk update

安装curl:

apk add curl

安装telnet

apk add busybox-extras

到此这篇关于alpine镜像中安装telnet的文章就介绍到这了,更多相关alpine安装telnet内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com